* 1.9.x fixes

This commit is contained in:
marco 2004-07-18 10:00:29 +00:00
parent 2b2a998ce6
commit 3e7ae43113
3 changed files with 15 additions and 11 deletions

View File

@ -2,31 +2,35 @@ program Example30;
{ Program to demonstrate the FSStat function. }
uses linux;
uses BaseUnix,Unix;
var s : string;
info : statfs;
info : tstatfs;
begin
writeln ('Info about current partition : ');
s:='.';
while s<>'q' do
begin
if not fsstat (s,info) then
if statfs (s,info)<>0 then
begin
writeln('Fstat failed. Errno : ',linuxerror);
halt (1);
writeln('Fstat failed. Errno : ',fpgeterrno);
halt (1);
end;
writeln;
writeln ('Result of fsstat on file ''',s,'''.');
writeln ('fstype : ',info.fstype);
writeln ('fstype : ',info.ftype);
writeln ('bsize : ',info.bsize);
writeln ('bfree : ',info.bfree);
writeln ('bavail : ',info.bavail);
writeln ('files : ',info.files);
writeln ('ffree : ',info.ffree);
{$ifdef FreeBSD}
writeln ('fsid : ',info.fsid[0]);
{$else}
writeln ('fsid : ',info.fsid);
writeln ('Namelen : ',info.namelen);
{$endif}
write ('Type name of file to do fsstat. (q quits) :');
readln (s)
end;

View File

@ -2,12 +2,12 @@ program Example31;
{ Program to demonstrate the Dup function. }
uses linux;
uses baseunix;
var f : text;
begin
if not dup (output,f) then
if fpdup (output,f)<>0 then
Writeln ('Dup Failed !');
writeln ('This is written to stdout.');
writeln (f,'This is written to the dup file, and flushed');flush(f);

View File

@ -2,7 +2,7 @@ program Example31;
{ Program to demonstrate the Dup function. }
uses linux;
uses BaseUnix;
var f : text;
i : longint;
@ -11,12 +11,12 @@ begin
Assign (f,'text.txt');
Rewrite (F);
For i:=1 to 10 do writeln (F,'Line : ',i);
if not dup2 (output,f) then
if fpdup2 (output,f)<>0 then
Writeln ('Dup2 Failed !');
writeln ('This is written to stdout.');
writeln (f,'This is written to the dup file, and flushed');
flush(f);
writeln;
{ Remove file. Comment this if you want to check flushing.}
Unlink ('text.txt');
fpUnlink ('text.txt');
end.