Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear monks

Hopefully this is a simple one. I'm running a perl script which unzips a file using gunzip. This was failing and it appears the script doesn't have permission to either read the the gz file or to create the unzipped file. The permissions on the file to unzip are rwxrwxrwx so I presume it must be an issue with creating the new file. I ran the script under sudo and the file was gunzipped successfully confirming a permissions issue.

How do I give the script permission to create the unzipped file? I am surprised by this as the script makes a directory in the same location without problem

Thanks for your help

Replies are listed 'Best First'.
Re: gunzip failure in perl script
by choroba (Cardinal) on Oct 30, 2010 at 00:38 UTC
    You need a write permission to the directory where the script is going to create the files.
Re: gunzip failure in perl script
by bichonfrise74 (Vicar) on Oct 29, 2010 at 22:34 UTC
    Please post your code.
Re: gunzip failure in perl script
by Anonymous Monk on Oct 29, 2010 at 21:56 UTC
    I forgot to add the script has full permissions when i  ls -l it

      you also need permissions to whatever the script is calling - if your user can't run gzip, your script probably won't be able to (security issue).

      however, if you can't solve it from this point, it would be helpful to show us the script as well as: mkdir test; cd test; echo "" > testfile; umask; ls -l; ls -ld $PWD

      and show us the permissions on the script and whatever modules or programs the script uses (start with the permissions on perl itself if you can't run any perl as that user).