Delphi Programming RTL Reference|By Category|Alphabetically|By Unit
function DirectoryExists(const DirName: string): Boolean;
Returns True if a specified directory exists.
If DirName specifies a full path name, DirectoryExists searches for the directory along the designated path. Otherwise, the DirName parameter is interpreted as a relative path name from the current directory.
var Dir : widestring;
if SelectDirectory('My message','d:\!gajba',Dir) then
showmessage('Folder selected ' + Dir);
//prepare code to use directory 'Dir',
//code ... code
//make sure Dir was not deleted!
if NOT DirectoryExists(Dir) then
begin
ShowMessage('Ups, somebody deleted your folder?! Let's create it again!');
ForceDirectories(Dir);
end;
|
Browse for Computers, Folders, Files and Printers
Use Delphi (and API) to display the directory structure of a computer and allow a user to select a folder without using the Common Dialog control. Plus: select a printer or network computer.
SelectDirectory, GetCurrentDir, FileExists, ForceDirectories
|
Free Delphi code snippet inside every Delphi Newsletter! |
|
|
|
Got some code to share? Got a question? Need some help? |
|
|