[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'oldlinux' (#rtl)

FSStat

Retrieve filesystem information.

Declaration

Source position: line 0

function FSStat(

  Path: PathStr;

  var Info: Statfs

):Boolean;

function FSStat(

  Fd: LongInt;

  var Info: Statfs

):Boolean;

Description

FSStat returns in Info information about the filesystem on which the file Path resides, or on which the file with file descriptor fd resides. Info is of type statfs. The function returns True if the call was succesfull, False if the call failed.

Errors

LinuxError is used to report errors.

sys_enotdir
A component of Path is not a directory.
sys_einval
Invalid character in Path.
sys_enoent
Path does not exist.
sys_eaccess
Search permission is denied for component inPath.
sys_eloop
A circular symbolic link was encountered in Path.
sys_eio
An error occurred while reading from the filesystem.

See also

FStat

  

Retrieve information about a file

LStat

  

Return information about symbolic link. Do not follow the link

Example

program Example30;

{ Program to demonstrate the FSStat function. }

uses oldlinux;

var s : string;
    info : statfs;

begin
  writeln ('Info about current partition : ');
  s:='.';
  while s<>'q' do
    begin
    if not fsstat (s,info) then
       begin
       writeln('Fstat failed. Errno : ',linuxerror);
       halt (1);
       end;
    writeln;
    writeln ('Result of fsstat on file ''',s,'''.');
    writeln ('fstype  : ',info.fstype);
    writeln ('bsize   : ',info.bsize);
    writeln ('bfree   : ',info.bfree);
    writeln ('bavail  : ',info.bavail);
    writeln ('files   : ',info.files);
    writeln ('ffree   : ',info.ffree);
    writeln ('fsid    : ',info.fsid);
    writeln ('Namelen : ',info.namelen);
    write ('Type name of file to do fsstat. (q quits) :');
    readln (s)
    end;
end.
The latest version of this document can be found at lazarus-ccr.sourceforge.net.