unxovl.inc 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2002 by Marco van de Voort
  5. Some generic overloads for stringfunctions in the unix unit.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. Function StatFS(Path:Pathstr;Var Info:Tstatfs):cint;
  13. {
  14. Get all information on a fileSystem, and return it in Info.
  15. Path is the name of a file/directory on the fileSystem you wish to
  16. investigate.
  17. }
  18. begin
  19. path:=path+#0;
  20. statfs:=statfs(pchar(@path[1]),info);
  21. end;
  22. Function fpReadLink(Name:pathstr):pathstr;
  23. {
  24. Read a link (where it points to)
  25. }
  26. var
  27. LinkName : pathstr;
  28. i : cint;
  29. begin
  30. Name:=Name+#0;
  31. i:=fpReadLink(@Name[1],@LinkName[1],high(linkname));
  32. if i>0 then
  33. begin
  34. linkname[0]:=chr(i);
  35. fpReadLink:=LinkName;
  36. end
  37. else
  38. fpReadLink:='';
  39. end;
  40. {
  41. $Log$
  42. Revision 1.2 2004-01-01 16:10:23 marco
  43. * fpreadlink(pathstr) moved to unxovl (since not platform specific),
  44. small fixes for "make all OPT='-dFPC_USE_LIBC'
  45. Revision 1.1 2003/12/30 12:27:44 marco
  46. * FPC_USE_LIBC
  47. }