2

I generated a Unix executable with PyInstaller. I then changed the permissions of the file using chmod +x+x+x my_file

-rwxr-xr-x my_file

When I serve that file from mysite.appspot.com/static/filename, I successfully download my app but the file permissions change and it can't be run as an executable anymore.

-rw-r--r my_file_after_being_downloaded

How can I serve my file while keeping its permissions unchanged?

(note that I can confirm that manually chmod-ing this downloaded file does turn it back into a Unix executable, and hence opens with double-click.)

1 Answer 1

4

HTTP doesn't support file permissions, i.e. there is no way to make downloaded file exacutable by default.

If your concern is to avoid users to mess with chmod, you can serve .tar.gz archive, which is able to keep records if file is executable or not

2
  • Tested this-- works perfectly. Thank you for teaching me something new @Marat.
    – rd108
    Jan 7, 2014 at 12:41
  • note: I ended up using .zip compression as personal preference
    – rd108
    Jan 7, 2014 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.