Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,36 @@
Program FileTruncate;
uses
SysUtils;
var
myfile: file of byte;
filename: string;
position: integer;
begin
write('File for truncation: ');
readln(filename);
if not FileExists(filename) then
begin
writeln('Error: File does not exist.');
exit;
end;
write('Truncate position: ');
readln(position);
Assign(myfile, filename);
Reset(myfile);
if FileSize(myfile) < position then
begin
writeln('Warning: The file "', filename, '" is too short. No need to truncate at position ', position);
Close(myfile);
exit;
end;
Seek(myfile, position);
Truncate(myfile);
Close(myfile);
writeln('File "', filename, '" truncated at position ', position, '.');
end.