ex40.pp 829 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Program Example40;
  2. { This program demonstrates the FileGetAttr function }
  3. Uses sysutils;
  4. Procedure Testit (Name : String);
  5. Var F : Longint;
  6. Begin
  7. F:=FileGetAttr(Name);
  8. If F<>-1 then
  9. begin
  10. Writeln ('Testing : ',Name);
  11. If (F and faReadOnly)<>0 then
  12. Writeln ('File is ReadOnly');
  13. If (F and faHidden)<>0 then
  14. Writeln ('File is hidden');
  15. If (F and faSysFile)<>0 then
  16. Writeln ('File is a system file');
  17. If (F and faVolumeID)<>0 then
  18. Writeln ('File is a disk label');
  19. If (F and faArchive)<>0 then
  20. Writeln ('File is artchive file');
  21. If (F and faDirectory)<>0 then
  22. Writeln ('File is a directory');
  23. end
  24. else
  25. Writeln ('Error reading attribites of ',Name);
  26. end;
  27. begin
  28. testit ('ex40.pp');
  29. testit (ParamStr(0));
  30. testit ('.');
  31. testit ('/');
  32. End.