• Facebook
  • Twitter
  • Reddit
  • StumbleUpon
  • Digg
  • email

All Samples(3054)  |  Call(2989)  |  Derive(0)  |  Import(65)
chmod(path, mode)

Change the access permissions of a file.

src/f/u/fuse-python-0.2/example/xmp.py   fuse-python(Download)
    def chmod(self, path, mode):
        os.chmod("." + path, mode)
 
    def chown(self, path, user, group):
        os.chown("." + path, user, group)
 
    def truncate(self, path, len):

src/d/u/dutils-0.0.10/dutils/sample/path.py   dutils(Download)
    def chmod(self, mode):
        os.chmod(self, mode)
 
    if hasattr(os, 'chown'):
        def chown(self, uid, gid):
            os.chown(self, uid, gid)
 

src/p/e/pexpect-HEAD/pexpect/examples/bd_serv.py   pexpect(Download)
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    localhost = '127.0.0.1'
    s.bind('/tmp/mysock')
    os.chmod('/tmp/mysock',0777)
    print 'Listen'
    s.listen(1)
    print 'Accept'

src/l/a/Langtangen-HEAD/src/py/examples/q4w/q4w-generate.py   Langtangen(Download)
#dbfile.close()
 
# make sure that the CGI scripts are executable:
os.chmod('q4w-record.cgi', 0755)
os.chmod('q4w-statistics.cgi', 0755)
# make sure the datafiles are writeable for all users:
os.chmod(filenamebase+'.dbsum', 0777)
dbfile = open(filenamebase+'.dball', 'w')
dbfile.close()
os.chmod(filenamebase+'.dball', 0777)
dbfile = open('ans.html', 'w')
dbfile.close()
os.chmod('ans.html', 0777)
chmod a+rxw %s %s ans.html
""" % (filenamebase+'.dbsum', filenamebase+'.dball'))
f.close()
os.chmod('chmod.files', 0755)
 
# write a little script reset that resets the database
# by making empty .dball and ans.html file and copying
"""
        % vars())
f.close()
os.chmod('reset_database', 0755)
 
 
print """

src/l/a/lamson-1.0/examples/librelist/app/model/archive.py   lamson(Download)
def fix_permissions(path):
    os.chmod(path, DIR_MOD)
 
    for root, dirs, files in os.walk(path):
        os.chmod(root, DIR_MOD)
        for f in files:
            os.chmod(os.path.join(root, f), FILE_MOD)

src/p/e/pexpect-2.4/examples/bd_serv.py   pexpect(Download)
    s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    localhost = '127.0.0.1'
    s.bind('/tmp/mysock')
    os.chmod('/tmp/mysock',0777)
    print 'Listen'
    s.listen(1)
    print 'Accept'

src/m/a/matplotlib-HEAD/py4science/examples/mkprob.py   matplotlib(Download)
        skel = src2skel(infile)
        with open(fname_skel,'w') as fskel:
            fskel.write(skel)
        os.chmod(fname_skel,fmode)
 
        # Reset the input file pointer and generate the solution
        infile.seek(0)
        soln = src2soln(infile)
        with open(fname_soln,'w') as fsoln:
            fsoln.write(soln)
        os.chmod(fname_soln,fmode)

src/p/y/py2app-0.5.2/examples/EggInstaller/EggInstaller.py   py2app(Download)
def main():
    fd, name = tempfile.mkstemp(suffix='.py', prefix='EggInstaller')
    script = os.fdopen(fd, 'w+b')
    script.write(SCRIPT % (sys.executable, ['--'] + sys.argv[1:]))
    script.flush()
    script.close()
    os.chmod(name, 0700)

src/p/e/pexpect-HEAD/pexpect/examples/topip.py   pexpect(Download)
    # save state to TOPIP_LAST_RUN_STATS
    try:
        pickle.dump(s, file(TOPIP_LAST_RUN_STATS,'w'))
        os.chmod (TOPIP_LAST_RUN_STATS, 0664)
    except:
        pass
    # p.logout()

src/p/e/pexpect-HEAD/examples/topip.py   pexpect(Download)
    # save state to TOPIP_LAST_RUN_STATS
    try:
        pickle.dump(s, file(TOPIP_LAST_RUN_STATS,'w'))
        os.chmod (TOPIP_LAST_RUN_STATS, 0o664)
    except:
        pass
    # p.logout()

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next