Browse Source

* fpReadlink(pathstr) overload added

peter 22 years ago
parent
commit
73b2b9d24a
2 changed files with 19 additions and 0 deletions
  1. 18 0
      rtl/linux/unxsysc.inc
  2. 1 0
      rtl/linux/unxsysch.inc

+ 18 - 0
rtl/linux/unxsysc.inc

@@ -98,3 +98,21 @@ begin
 end;
 }
 
+Function fpReadLink(Name:pathstr):pathstr;
+{
+  Read a link (where it points to)
+}
+var
+  LinkName : pathstr;
+  i : cint;
+begin
+  Name:=Name+#0;
+  i:=fpReadLink(@Name[1],@LinkName[1],high(linkname));
+  if i>0 then
+   begin
+     linkname[0]:=chr(i);
+     fpReadLink:=LinkName;
+   end
+  else
+   fpReadLink:='';
+end;

+ 1 - 0
rtl/linux/unxsysch.inc

@@ -7,4 +7,5 @@ Function fpLstat(path:pchar;Info:pstat):cint;
 Function fpLstat(Filename: PathStr;Info:pstat):cint;
 Function fpSymlink(oldname,newname:pchar):cint;
 Function fpReadLink(name,linkname:pchar;maxlen:size_t):cint;
+Function fpReadLink(name:PathStr):PathStr;