ex8.pp 499 B

123456789101112131415161718
  1. Program Example8;
  2. uses Dos;
  3. { Program to demonstrate the GetFAttr function. }
  4. var
  5. Attr : Word;
  6. f : File;
  7. begin
  8. Assign(f,ParamStr(1));
  9. GetFAttr(f,Attr);
  10. WriteLn('File ',ParamStr(1),' has attribute ',Attr);
  11. if (Attr and archive)<>0 then WriteLn('- Archive');
  12. if (Attr and directory)<>0 then WriteLn('- Directory');
  13. if (Attr and readonly)<>0 then WriteLn('- Read-Only');
  14. if (Attr and sysfile)<>0 then WriteLn('- System');
  15. if (Attr and hidden)<>0 then WriteLn('- Hidden');
  16. end.