mcarthey has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::File::SetAttributes not numeric?
by afoken (Chancellor) on Jun 05, 2009 at 19:25 UTC | |
|
Re: Win32::File::SetAttributes not numeric?
by mcarthey (Novice) on Jun 05, 2009 at 19:36 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 19:42 UTC | |
by mcarthey (Novice) on Jun 05, 2009 at 19:55 UTC | |
by ikegami (Patriarch) on Jun 05, 2009 at 19:57 UTC | |
by mcarthey (Novice) on Jun 05, 2009 at 20:02 UTC | |
| |
by afoken (Chancellor) on Jun 06, 2009 at 06:38 UTC | |
by mcarthey (Novice) on Jun 08, 2009 at 14:25 UTC |