Subject: | Only works with files |
The perldoc for this modules states:
"The new constructor creates a new handle to the Win32 filesystem attributes
of an existing file or directory."
But it really only works with files. It was throwing the error:
"File 'C:/tmp/path/to/directory' does not exist" when trying to modify file
attributes on a folder.
Here is a patch to correct the problem:
diff -Naur Orig/object.pm File/object.pm
--- Orig/object.pm 2010-08-25 12:06:40.000000000 -0500
+++ File/object.pm 2010-08-25 12:33:06.000000000 -0500
@@ -80,9 +80,9 @@
my $path = shift;
my $autowrite = !! shift;
unless ( $path ) {
- Carp::croak("Did not provide a file name");
+ Carp::croak("Did not provide a pathname");
}
- unless ( -f $path ) {
+ unless ( -e $path ) {
Carp::croak("File '$path' does not exist");
}