mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 05:09:07 +02:00
* use .tmp as extension so it gets cleaned
This commit is contained in:
parent
a8a4c9a0e6
commit
7002745651
@ -8,31 +8,31 @@
|
|||||||
{ do_seek() }
|
{ do_seek() }
|
||||||
{ do_truncate() }
|
{ do_truncate() }
|
||||||
|
|
||||||
{ This routine overwrites/creates a filename called test.dat }
|
{ This routine overwrites/creates a filename called test.tmp }
|
||||||
{ fills it up with values, checks its file size, reads the }
|
{ fills it up with values, checks its file size, reads the }
|
||||||
{ data back in, }
|
{ data back in, }
|
||||||
|
|
||||||
Program tio;
|
Program tio;
|
||||||
|
|
||||||
const
|
const
|
||||||
FILE_NAME = 'test.dat';
|
FILE_NAME = 'test.tmp';
|
||||||
FILE_NAME2 = 'test1.dat';
|
FILE_NAME2 = 'test1.tmp';
|
||||||
DATA_SIZE = 17;
|
DATA_SIZE = 17;
|
||||||
|
|
||||||
DATA: array[1..DATA_SIZE] of byte =
|
DATA: array[1..tmpA_SIZE] of byte =
|
||||||
($01,$02,$03,$04,$05,$06,$07,$08,
|
($01,$02,$03,$04,$05,$06,$07,$08,
|
||||||
$09,$A,$B,$C,$D,$E,$F,$10,
|
$09,$A,$B,$C,$D,$E,$F,$10,
|
||||||
$11
|
$11
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{$I+}
|
{$I+}
|
||||||
var
|
var
|
||||||
F: File;
|
F: File;
|
||||||
I: Integer;
|
I: Integer;
|
||||||
b: byte;
|
b: byte;
|
||||||
readData : array[1..DATA_SIZE] of byte;
|
readData : array[1..tmpA_SIZE] of byte;
|
||||||
BytesRead, BytesWritten : word;
|
BytesRead, BytesWritten : word;
|
||||||
Begin
|
Begin
|
||||||
{------------------------ create and play with a new file --------------------------}
|
{------------------------ create and play with a new file --------------------------}
|
||||||
@ -96,14 +96,17 @@ Begin
|
|||||||
Close(F);
|
Close(F);
|
||||||
Assign(F,FILE_NAME2);
|
Assign(F,FILE_NAME2);
|
||||||
WriteLn('renaming file...');
|
WriteLn('renaming file...');
|
||||||
ReName(F,'test3.dat');
|
ReName(F,'test3.tmp');
|
||||||
WriteLn('erasing file....');
|
WriteLn('erasing file....');
|
||||||
Erase(F);
|
Erase(F);
|
||||||
end.
|
end.
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-07-14 04:25:00 carl
|
Revision 1.2 2001-07-30 22:09:34 peter
|
||||||
|
* use .tmp as extension so it gets cleaned
|
||||||
|
|
||||||
|
Revision 1.1 2001/07/14 04:25:00 carl
|
||||||
system unit testing : basic I/O
|
system unit testing : basic I/O
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user