tstatx.pp 545 B

123456789101112131415161718192021222324252627
  1. { %target=linux }
  2. uses
  3. ctypes,baseunix,linux;
  4. var
  5. mystatx : statx;
  6. res : cint;
  7. f : text;
  8. begin
  9. assign(f,'test.txt');
  10. rewrite(f);
  11. write(f,'ccccc');
  12. close(f);
  13. res:=fpstatx(AT_FDCWD,'test.txt',AT_SYMLINK_NOFOLLOW,STATX_ALL,mystatx);
  14. erase(f);
  15. if res<>0 then
  16. begin
  17. halt(1);
  18. end;
  19. writeln('statx.stx_mask = %',binstr(mystatx.stx_mask,32));
  20. writeln('statx.size = ',mystatx.stx_size);
  21. if mystatx.stx_size<>5 then
  22. halt(1);
  23. writeln('statx.mode = %',binstr(mystatx.stx_mode,16));
  24. writeln('ok');
  25. end.