ex8.pp 474 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 $20)<>0 then WriteLn('- Archive');
  12. if (Attr and $10)<>0 then WriteLn('- Directory');
  13. if (Attr and $4)<>0 then WriteLn('- Read-Only');
  14. if (Attr and $2)<>0 then WriteLn('- System');
  15. if (Attr and $1)<>0 then WriteLn('- Hidden');
  16. end.