Hencah
asked on
Setting file attribute
Hi,
I have a problem to set file attribute. I want to clear read-only attribute from a file which has read-only attribute.
HOw to do this? Thank you very much for your help.
Regards cah
I have a problem to set file attribute. I want to clear read-only attribute from a file which has read-only attribute.
HOw to do this? Thank you very much for your help.
Regards cah
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To clear the read-only attribute:
var attr: DWORD;
begin
attr := GetFileAttributes('file.tx t');
SetFileAttributes('File.tx t', attr and not FILE_ATTRIBUTE_READONLY);
end;
var attr: DWORD;
begin
attr := GetFileAttributes('file.tx
SetFileAttributes('File.tx
end;
I don't think the first piece of code would work, but the second one sure will ;-)
..-=ViKtOr=-..
..-=ViKtOr=-..
Cheers,
Raymond.