|
@@ -2,26 +2,26 @@ Program Example53;
|
|
|
|
|
|
{ Program to demonstrate the S_ISLNK function. }
|
|
|
|
|
|
-Uses linux;
|
|
|
+Uses BaseUnix,Unix;
|
|
|
|
|
|
Var Info : Stat;
|
|
|
|
|
|
begin
|
|
|
- if LStat (paramstr(1),info) then
|
|
|
+ if fpLStat (paramstr(1),@info)=0 then
|
|
|
begin
|
|
|
- if S_ISLNK(info.mode) then
|
|
|
+ if fpS_ISLNK(info.st_mode) then
|
|
|
Writeln ('File is a link');
|
|
|
- if S_ISREG(info.mode) then
|
|
|
+ if fpS_ISREG(info.st_mode) then
|
|
|
Writeln ('File is a regular file');
|
|
|
- if S_ISDIR(info.mode) then
|
|
|
+ if fpS_ISDIR(info.st_mode) then
|
|
|
Writeln ('File is a directory');
|
|
|
- if S_ISCHR(info.mode) then
|
|
|
+ if fpS_ISCHR(info.st_mode) then
|
|
|
Writeln ('File is a character device file');
|
|
|
- if S_ISBLK(info.mode) then
|
|
|
+ if fpS_ISBLK(info.st_mode) then
|
|
|
Writeln ('File is a block device file');
|
|
|
- if S_ISFIFO(info.mode) then
|
|
|
+ if fpS_ISFIFO(info.st_mode) then
|
|
|
Writeln ('File is a named pipe (FIFO)');
|
|
|
- if S_ISSOCK(info.mode) then
|
|
|
+ if fpS_ISSOCK(info.st_mode) then
|
|
|
Writeln ('File is a socket');
|
|
|
end;
|
|
|
end.
|