1

I am trying to create a setup.py that will build rpm/deb packages and I want it to create a blank directory with 777 permissions. I have it creating the directory via data_files

  data_files=[ 
                ( '/var/spool/my_dir', [] )
             }

But it creates the directory with 755 permissions. How do i get setup.py to create this directory with 777 permissions??

user1261654
  • 45
  • 1
  • 6
  • Possible duplicate of [set file permission in setup.py file](http://stackoverflow.com/questions/5932804/set-file-permission-in-setup-py-file) – bufh Apr 08 '16 at 07:46

2 Answers2

1

There is a way to do this. You will need to override the install method. See my answer here: set file permissions in setup.py file

Community
  • 1
  • 1
oz123
  • 27,559
  • 27
  • 125
  • 187
0

I don't think there's a way to specify file permissions in the call to setup.

You could always import os and do something like os.chmod('/var/spool/my_dir', 0777) after the setup call. To be honest though, I wonder if you really need those permissions.

John Brodie
  • 5,909
  • 1
  • 19
  • 29
  • thanks for the reply John. I don't think os.chmod works when building an rpm/deb package (i could be wrong). Thanks again. – user1261654 Jan 31 '13 at 14:30