terça-feira, 22 de setembro de 2009

Verificando atributo do arquivo

{Crie uma var do tipo word, por ex., Attributes. Depois, atribua a esta var o valor retornado por FileGetAttr. Ex.: }
var
Attributes: Word;
begin
Attributes := FileGetAttr( 'nomedoarquivo' );
// Supondo 4 CheckBoxe's, 1 para cada atributo, Ok?
CheckBox1.Checked := (Attributes and faReadOnly) = faReadOnly;
CheckBox2.Checked := (Attributes and faArchive) = faArchive;
CheckBox3.Checked := (Attributes and faSysFile) = faSysFile;
CheckBox4.Checked := (Attributes and faHidden) = faHidden;
end;

Nenhum comentário:

Postar um comentário