Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
28
Task/Empty-directory/Delphi/empty-directory.delphi
Normal file
28
Task/Empty-directory/Delphi/empty-directory.delphi
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
program Empty_directory;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
uses
|
||||
System.SysUtils,
|
||||
System.IOUtils;
|
||||
|
||||
function IsDirectoryEmpty(dir: string): Boolean;
|
||||
var
|
||||
count: Integer;
|
||||
begin
|
||||
count := Length(TDirectory.GetFiles(dir)) + Length(TDirectory.GetDirectories(dir));
|
||||
Result := count = 0;
|
||||
end;
|
||||
|
||||
var
|
||||
i: Integer;
|
||||
|
||||
const
|
||||
CHECK: array[Boolean] of string = (' is not', ' is');
|
||||
|
||||
begin
|
||||
if ParamCount > 0 then
|
||||
for i := 1 to ParamCount do
|
||||
Writeln(ParamStr(i), CHECK[IsDirectoryEmpty(ParamStr(i))], ' empty');
|
||||
Readln;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue