next up previous contents index
Next: S_ISREG Up: Functions and procedures Previous: S_ISFIFO

S_ISLNK

   

Declaration:

Function S_ISLNK (m:integer) : boolean;

Description:

S_ISLNK checks the file mode m to see whether the file is a symbolic link. If so it returns True

Errors:

FStat, S_ISREG, S_ISDIR, S_ISCHR, S_ISBLK, S_ISFIFO, S_ISSOCK

See also:

<tex2html_undef_mark>

Example
Program Example53;

{ Program to demonstrate the S_ISLNK function. }

Uses linux;

Var Info : Stat;

begin
  if FStat (paramstr(1),info) then
    begin
    if S_ISLNK(info.mode) then 
      Writeln ('File is a link');
    if S_ISREG(info.mode) then 
      Writeln ('File is a regular file');
    if S_ISDIR(info.mode) then 
      Writeln ('File is a directory');
    if S_ISCHR(info.mode) then 
      Writeln ('File is a character device file');
    if S_ISBLK(info.mode) then 
      Writeln ('File is a block device file');
    if S_ISFIFO(info.mode) then 
      Writeln ('File is a named pipe (FIFO)');
    if S_ISSOCK(info.mode) then 
      Writeln ('File is a socket');
    end;
end.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998