mirror of
https://github.com/vapaamies/KolibriOS.git
synced 2025-09-22 23:23:49 +02:00
CRT functions/procedures made safe with overloaded Write/WriteLn implementations
This commit is contained in:
@@ -21,36 +21,36 @@ begin
|
||||
|
||||
if ReadFolder(FolderPath, FolderInformation, 0, 0, 0, BlocksRead) = 0 then
|
||||
with FolderInformation do
|
||||
Write('Folder "%s" contains %u files and/or folders.'#10#10, FolderPath, FileCount)
|
||||
WriteLn('Folder "%s" contains %u files and/or folders.', [FolderPath, FileCount], 2)
|
||||
else
|
||||
Write('Folder "%s" can not be read.'#10, FolderPath);
|
||||
WriteLn('Folder "%s" can not be read.', [FolderPath]);
|
||||
|
||||
Pos := 0;
|
||||
while ReadFolder(FolderPath, FolderInformation, 1, Pos, 0, BlocksRead) = 0 do
|
||||
begin
|
||||
with FolderInformation, FileInformation[0] do
|
||||
begin
|
||||
Write('FileName = %s'#10, Name);
|
||||
WriteLn('FileName = %s', [Name]);
|
||||
with Attributes do
|
||||
begin
|
||||
Write( 'SizeLo = %u'#10, TInt64Rec(Size).Lo);
|
||||
Write( 'SizeHi = %u'#10, TInt64Rec(Size).Hi);
|
||||
WriteLn( 'SizeLo = %u', [TInt64Rec(Size).Lo]);
|
||||
WriteLn( 'SizeHi = %u', [TInt64Rec(Size).Hi]);
|
||||
with Modify.Date do
|
||||
Write('Modify Date = %02d.%02d.%02d'#10, Day, Month, Year);
|
||||
WriteLn('Modify Date = %02d.%02d.%02d', [Day, Month, Year]);
|
||||
with Modify.Time do
|
||||
Write('Modify Time = %02d:%02d:%02d'#10, Hours, Minutes, Seconds);
|
||||
WriteLn('Modify Time = %02d:%02d:%02d', [Hours, Minutes, Seconds]);
|
||||
with Access.Date do
|
||||
Write('Access Date = %02d.%02d.%02d'#10, Day, Month, Year);
|
||||
WriteLn('Access Date = %02d.%02d.%02d', [Day, Month, Year]);
|
||||
with Access.Time do
|
||||
Write('Access Time = %02d:%02d:%02d'#10, Hours, Minutes, Seconds);
|
||||
WriteLn('Access Time = %02d:%02d:%02d', [Hours, Minutes, Seconds]);
|
||||
with Creation.Date do
|
||||
Write('Creation Date = %02d.%02d.%02d'#10, Day, Month, Year);
|
||||
WriteLn('Creation Date = %02d.%02d.%02d', [Day, Month, Year]);
|
||||
with Creation.Time do
|
||||
Write('Creation Time = %02d:%02d:%02d'#10, Hours, Minutes, Seconds);
|
||||
Write( 'Attributes = 0x%08x'#10, Attributes);
|
||||
WriteLn('Creation Time = %02d:%02d:%02d', [Hours, Minutes, Seconds]);
|
||||
WriteLn( 'Attributes = 0x%08x', [Attributes]);
|
||||
end;
|
||||
end;
|
||||
Write(#10);
|
||||
WriteLn;
|
||||
Inc(Pos);
|
||||
end;
|
||||
end.
|
||||
|
Reference in New Issue
Block a user