This is the mail archive of the
mailing list for the Cygwin project.
Re: Nasty permissions / pathing bug in perl on 1.7
On 11/29/2009 11:43 AM, Steven Hartland wrote:
Just been chasing my tail for hours trying to figure out why the
permissions on a file weren't being set even though no error was being
thrown.I don't have an answer for your problem however why not do:
It turns out that giving a dos like path to chmod in perl under 1.7
although doesn't error it doesn't do anything either.
Here's my little test case:
print `touch /tmp/test.exe; ls -l /tmp/test.exe`;
if ( ! chmod 0777, 'C:/cygwin/tmp/test.exe' )
print STDERR "Failed to chmod ($!)\n";
die "Failed to chmod ($!)"
unless chmod 0777, 'C:/cygwin/tmp/test.exe';
"die" writing to STDERR and exits with a non-zero status. Additionally,
if you don't put a '\n' in the message, die will print out the line
number of where it was called. Finally, unless is a cleaner way of
specifying not logic (IMHO).
Andrew DeFaria <http://defaria.com>
The Definition of an Upgrade: Take old bugs out, put new ones in.
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple