Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a ksh file which will download a zip file from the internet in the /tmp directory with name f.zip

Why do I get Permission denied?

$ ./downloadbcfi
Current name is /download.files.R1201BHtm.zip
/tmp/f.zip: Permissin denied

When I look at the permission on the /tmp directory everything is ok as below: enter image description here

share|improve this question

migrated from stackoverflow.com Feb 16 '12 at 2:57

This question came from our site for professional and enthusiast programmers.

    
It could be because /tmp/f.zip already exists. –  Sjoerd Feb 15 '12 at 12:09
    
tried to run script as root? –  Oleg Mikheev Feb 15 '12 at 12:14
2  
Is the shell really spelling "permission" wrong, or is this not an actual copy and paste? –  Wooble Feb 15 '12 at 12:18
    
You are right /tmp/f.zip already exists and i have not permission to write to it. thanks –  itro Feb 15 '12 at 13:21

2 Answers 2

up vote 2 down vote accepted

Use this command in command line tool

chmod 0777 /tmp/f.zip
share|improve this answer

if you have ran your script as root and now as normal user. Then you may not have permission to read/write f.zip

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.