Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
24
Task/Make-directory-path/Delphi/make-directory-path.delphi
Normal file
24
Task/Make-directory-path/Delphi/make-directory-path.delphi
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
program Make_directory_path;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
System.IOUtils;
|
||||
|
||||
const
|
||||
Path1 = '.\folder1\folder2\folder3'; // windows relative path (others OS formats are acepted)
|
||||
Path2 = 'folder4\folder5\folder6';
|
||||
|
||||
begin
|
||||
// "ForceDirectories" work with relative path if start with "./"
|
||||
if ForceDirectories(Path1) then
|
||||
Writeln('Created "', path1, '" sucessfull.');
|
||||
|
||||
// "TDirectory.CreateDirectory" work with any path format
|
||||
// but don't return sucess, requere "TDirectory.Exists" to check
|
||||
TDirectory.CreateDirectory(Path2);
|
||||
if TDirectory.Exists(Path2) then
|
||||
Writeln('Created "', path2, '" sucessfull.');
|
||||
Readln;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue