davidfilmer has asked for the wisdom of the Perl Monks concerning the following question:
Hello. I have this code, which is an attempt to duplicate the permissions of one file onto another:
Perl warns me:my $mode = (stat( $original_file ))[2]; my $perms = sprintf "%04o", $mode & 07777; chmod( $target_file, oct($perms) ) or warn "Could not chmod '$targe +t_file' to $perms: $!\n";
But it bloody well too does exist:Could not chmod '/data/dmu/share/Product/PMprofile' to 0644: A file or + directory in the path name does not exist.
I seek wisdom!!! Why does chmod not see my file? Thanks!> ll /data/dmu/share/Product/PMprofile -rw-rw-rw- 1 dfilmer wheel 1015 Jun 19 2012 /data/dmu/sha +re/Product/PMprofile
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: perl chmod tells me file does not exist (but it does)
by stephen (Priest) on May 17, 2013 at 22:07 UTC | |
by davidfilmer (Sexton) on May 17, 2013 at 22:10 UTC | |
Re: perl chmod tells me file does not exist (but it does)
by hippo (Bishop) on May 17, 2013 at 22:06 UTC | |
Re: perl chmod tells me file does not exist (but it does)
by Anneq (Vicar) on May 17, 2013 at 22:30 UTC |
Back to
Seekers of Perl Wisdom