unxovl.inc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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:ansistring;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. statfs:=statfs(pchar(path),info);
  20. end;
  21. Function fpReadLink(Name:ansistring):ansistring;
  22. {
  23. Read a link (where it points to)
  24. }
  25. var
  26. LinkName : ansistring;
  27. i : cint;
  28. begin
  29. SetLength(linkname,PATH_MAX);
  30. i:=fpReadLink(pchar(name),pchar(linkname),PATH_MAX);
  31. if i>0 then
  32. begin
  33. SetLength(linkname,i);
  34. fpReadLink:=LinkName;
  35. end
  36. else
  37. fpReadLink:='';
  38. end;
  39. {
  40. $Log$
  41. Revision 1.3 2004-11-03 15:00:43 marco
  42. * Pathstr eliminated
  43. Revision 1.2 2004/01/01 16:10:23 marco
  44. * fpreadlink(pathstr) moved to unxovl (since not platform specific),
  45. small fixes for "make all OPT='-dFPC_USE_LIBC'
  46. Revision 1.1 2003/12/30 12:27:44 marco
  47. * FPC_USE_LIBC
  48. }