I've tried a few methods of trying to set file attributes, but the result is always the same:
Argument "READONLY" isn't numeric
I've tried setting the value in the following manners:
Method 1:
Method 2:# get current file attributes Win32::File::GetAttributes($file, my $attr); # set file attributes to allow editing $attr |= READONLY; Win32::File::SetAttributes($file, $attr);
The $file value contains the path and filename. It appears obvious that the problem is the READONLY value, but I don't see how else to set this. I've searched but haven't been able to come up with anyone having the same problem. I thought perhaps READONLY was incorrectly defined, so have also tried other values such as NORMAL, and HIDDEN, but I have the same issue.my $setReadOnlyAttribute = READONLY; # set file attributes to allow editing Win32::File::SetAttributes($file, $setReadOnlyAttribute);
Thanks for any insight!
In reply to Win32::File::SetAttributes not numeric? by mcarthey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |