ex53.pp 736 B

123456789101112131415161718192021222324252627
  1. Program Example53;
  2. { Program to demonstrate the S_ISLNK function. }
  3. Uses BaseUnix,Unix;
  4. Var Info : Stat;
  5. begin
  6. if fpLStat (paramstr(1),@info)=0 then
  7. begin
  8. if fpS_ISLNK(info.st_mode) then
  9. Writeln ('File is a link');
  10. if fpS_ISREG(info.st_mode) then
  11. Writeln ('File is a regular file');
  12. if fpS_ISDIR(info.st_mode) then
  13. Writeln ('File is a directory');
  14. if fpS_ISCHR(info.st_mode) then
  15. Writeln ('File is a character device file');
  16. if fpS_ISBLK(info.st_mode) then
  17. Writeln ('File is a block device file');
  18. if fpS_ISFIFO(info.st_mode) then
  19. Writeln ('File is a named pipe (FIFO)');
  20. if fpS_ISSOCK(info.st_mode) then
  21. Writeln ('File is a socket');
  22. end;
  23. end.