Did I find the right examples for you? yes no

All Samples(74)  |  Call(0)  |  Derive(0)  |  Import(74)

src/p/y/pymacadmin-HEAD/utilities/diskimage_unittesting/tests/example_plist_test.py   pymacadmin(Download)
    owner = orig_imageinfo_stat[stat.ST_UID]
    group = orig_imageinfo_stat[stat.ST_GID]
    mode = orig_imageinfo_stat[stat.ST_MODE]
    num_mode = oct(mode & 0777)
    self.assertEqual(0, owner)

src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/logilab/common/fileutils.py   modern-python-example(Download)
from os.path import abspath
from os import sep, mkdir, remove, listdir, stat, chmod, walk
from stat import ST_MODE, S_IWRITE
from cStringIO import StringIO
 
      `stat` module for file permission's modes
    """
    mode = stat(filepath)[ST_MODE]
    if not mode & desired_mode:
        chmod(filepath, mode | desired_mode)
    def __init__(self, filepath, mode):
        self.original_mode = stat(filepath)[ST_MODE]
        self.mode_changed = False
        if mode in ('w', 'a', 'wb', 'ab'):
            if not self.original_mode & S_IWRITE:

src/m/o/modern-python-example-HEAD/lib/python2.7/site-packages/Crypto/Random/OSRNG/posix.py   modern-python-example(Download)
        # Test that /dev/urandom is a character special device
        f = open(self.name, "rb", 0)
        fmode = os.fstat(f.fileno())[stat.ST_MODE]
        if not stat.S_ISCHR(fmode):
            f.close()

src/m/2/M2Crypto-HEAD/examples/Zope/z2s.py   M2Crypto(Download)
            client_home_stat = os.stat(CLIENT_HOME)
            client_home_faults = []
            if not (client_home_stat[stat.ST_MODE]&01000):
                client_home_faults.append('does not have the sticky bit set')
            if client_home_stat[stat.ST_UID] != 0:

src/l/i/lib-pyFreenet-staging-HEAD/fcp/freenetfs.py   lib-pyFreenet-staging(Download)
        print "statToDict: info=%s" % str(info)
 
        mode = info[stat.ST_MODE]
        return {
            'isdir'  : stat.S_ISDIR(mode),
        #print "mode=%s" % mode
 
        statrec[stat.ST_MODE] |= mode
        statrec[stat.ST_INO] = inode
        statrec[stat.ST_DEV] = dev
        """
        if attr == 'mode':
            return self[stat.ST_MODE]
 
        if attr == 'isdir':
        if attr == 'isdir':
            if val:
                self[stat.ST_MODE] |= stat.S_IFDIR
            else:
                self[stat.ST_MODE] &= ~stat.S_IFDIR

src/p/o/poky-HEAD/bitbake/lib/bb/utils.py   poky(Download)
 
    if destexists:
        if stat.S_ISLNK(dstat[stat.ST_MODE]):
            try:
                os.unlink(dest)
                destexists = 0
            except Exception as e:
                pass
 
    if stat.S_ISLNK(sstat[stat.ST_MODE]):
        try:
            target = os.readlink(src)
            if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
                os.unlink(dest)
            os.symlink(target, dest)
    if renamefailed:
        didcopy = 0
        if stat.S_ISREG(sstat[stat.ST_MODE]):
            try: # For safety copy then move it over.
                shutil.copyfile(src, dest + "#new")
            if didcopy:
                os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
                os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
                os.unlink(src)
        except Exception as e:

src/b/i/bitbake-HEAD/lib/bb/utils.py   bitbake(Download)
 
    if destexists:
        if stat.S_ISLNK(dstat[stat.ST_MODE]):
            try:
                os.unlink(dest)
                destexists = 0
            except Exception as e:
                pass
 
    if stat.S_ISLNK(sstat[stat.ST_MODE]):
        try:
            target = os.readlink(src)
            if destexists and not stat.S_ISDIR(dstat[stat.ST_MODE]):
                os.unlink(dest)
            os.symlink(target, dest)
    if renamefailed:
        didcopy = 0
        if stat.S_ISREG(sstat[stat.ST_MODE]):
            try: # For safety copy then move it over.
                shutil.copyfile(src, dest + "#new")
            if didcopy:
                os.lchown(dest, sstat[stat.ST_UID], sstat[stat.ST_GID])
                os.chmod(dest, stat.S_IMODE(sstat[stat.ST_MODE])) # Sticky is reset on chown
                os.unlink(src)
        except Exception as e:

src/d/i/DIRAC-HEAD/Core/Security/VOMS.py   DIRAC(Download)
        continue
      if os.path.isfile( vomsesPath ):
        pathMode = os.stat( vomsesPath )[ stat.ST_MODE ]
        if ( pathMode & allPerms ) ^ requiredFilePerms == 0:
          return vomsesPath
      elif os.path.isdir( vomsesPath ):
        ok = True
        pathMode = os.stat( vomsesPath )[ stat.ST_MODE ]
        if ( pathMode & allPerms ) ^ requiredDirPerms:
          ok = False
        if ok:
          for fP in os.listdir( vomsesPath ):
            pathMode = os.stat( os.path.join( vomsesPath, fP ) )[ stat.ST_MODE ]

src/l/f/lfm-2.3/lfm/files.py   lfm(Download)
    if stat.S_ISLNK(lmode):
        try:
            mode = os.stat(f)[stat.ST_MODE]
        except OSError:
            return FTYPE_NLNK
    except OSError:
        return (FTYPE_UNKNOWN, 0, 'root', 'root', 0, 0)
    typ = __get_filetype(st[stat.ST_MODE], f)
    if typ in (FTYPE_DIR, FTYPE_LNK2DIR) and not pardir_flag and show_dirs_size:
        size = __get_size(f)
    except:
        group = unicode(st[stat.ST_GID])
    return (typ, stat.S_IMODE(st[stat.ST_MODE]), owner, group,
            size, st[stat.ST_MTIME])
 

src/s/a/salt-HEAD/salt/utils/find.py   salt(Download)
    def match(self, dirname, filename, fstat):
        return stat.S_IFMT(fstat[stat.ST_MODE]) in self.ftypes
 
 
class OwnerOption(Option):
    def match(self, dirname, filename, fstat):
        if not stat.S_ISREG(fstat[stat.ST_MODE]):
            return None
        dfilename = os.path.join(dirname, filename)
        with BufferedReader(dfilename, mode='rb') as bread:
            elif arg == 'type':
                result.append(
                    _FILE_TYPES.get(stat.S_IFMT(fstat[stat.ST_MODE]), '?')
                )
            elif arg == 'mode':
                result.append(fstat[stat.ST_MODE])
                    result.append(gid)
            elif arg == 'md5':
                if stat.S_ISREG(fstat[stat.ST_MODE]):
                    with salt.utils.fopen(fullpath, 'rb') as ifile:
                        buf = ifile.read(8192)

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