all tasks

This commit is contained in:
Ingy döt Net 2013-04-11 01:07:29 -07:00
parent b83f433714
commit 68f8f3e56b
14735 changed files with 178959 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.