mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 21:28:03 +02:00
+ Test for append on devices.
git-svn-id: trunk@6787 -
This commit is contained in:
parent
fd6fdfe896
commit
5784674f20
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -6263,6 +6263,7 @@ tests/tbs/tb0527.pp svneol=native#text/plain
|
||||
tests/tbs/tb0528.pp svneol=native#text/x-pascal
|
||||
tests/tbs/tb0530.pp svneol=native#text/plain
|
||||
tests/tbs/tb0531.pp svneol=native#text/plain
|
||||
tests/tbs/tb0532.pp svneol=native#text/x-pascal
|
||||
tests/tbs/ub0060.pp svneol=native#text/plain
|
||||
tests/tbs/ub0069.pp svneol=native#text/plain
|
||||
tests/tbs/ub0119.pp svneol=native#text/plain
|
||||
|
23
tests/tbs/tb0532.pp
Normal file
23
tests/tbs/tb0532.pp
Normal file
@ -0,0 +1,23 @@
|
||||
program tb0532;
|
||||
|
||||
{Append was the recommended way to open devices in TP.
|
||||
A pitfall is that you cannot seek to the end of a device.
|
||||
|
||||
It has to work on modern platforms too, because:
|
||||
- Rewrite will destroy the device on platforms where devices are
|
||||
files.
|
||||
- Reset doesn't allow writing to the device.
|
||||
}
|
||||
|
||||
var null:text;
|
||||
|
||||
begin
|
||||
{$ifdef Unix}
|
||||
assign(null,'/dev/null');
|
||||
{$else}
|
||||
assign(null,'NUL');
|
||||
{$endif}
|
||||
append(null);
|
||||
writeln(null,'Text disappearing into the black hole.');
|
||||
close(null);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user