help files
Z505 | PasWiki | FUQ | Search | Main Docs | API Guide



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

S_ISLNK

Is file a symbolic link

Declaration

Source position: oldlinux.pp line 1599

function S_ISLNK(

  m: Word

):Boolean;

Description

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

See also

FStat

  

Retrieve information about a file

S_ISFIFO

  

Is file a FIFO

S_ISREG

  

Is file a regular file

S_ISCHR

  

Is file a character device

S_ISBLK

  

Is file a block device

S_ISDIR

  

Is file a directory

S_ISSOCK

  

Is file a unix socket

Example

Program Example53;

{ Program to demonstrate the S_ISLNK function. }

Uses oldlinux;

Var Info : Stat;

begin
  if LStat (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.

Notes

 No notes exist for this page yet. 





lufdoc, Powtils, fpc, freepascal, delphi, kylix, c/c++, mysql, cgi web framework docs, Z505