当前位置: 首页>>代码示例>>Python>>正文


Python system.DRDFSLog类代码示例

本文整理汇总了Python中libs.system.DRDFSLog的典型用法代码示例。如果您正苦于以下问题:Python DRDFSLog类的具体用法?Python DRDFSLog怎么用?Python DRDFSLog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了DRDFSLog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: chmod

 def chmod(self, path, mode):
     DRDFSLog.debug('path=%s w/ mode %o' % (path, mode))
     try:
         os.chmod(path, mode)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例2: rmdir

 def rmdir(self, path):
     DRDFSLog.debug('path=%s' % (path))
     try:
         os.rmdir(path)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例3: chown

 def chown(self, path, uid, gid):
     DRDFSLog.debug("path=%s uid=%d gid=%d" % (path, uid, gid))
     try:
         os.chown(path, uid, gid)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例4: release

        def release(self, fd, dest, fsize, filename, created):
            """release handler.

            @param fd file discripter
            @param writelen size of data to be written
            """
            os.lseek(fd, 0, os.SEEK_SET)
            DRDFSLog.debug("fd = " + str(fd))
            if created == False:
                self.repl_info.ReplInfoWhenClose(filename, dest, 
                                                 self.access_info)

            else:
                try:
                    buf = os.read(fd, conf.bufsize)
                except os.error, e:
                    print "OSError in release (%s)" %(e)
                l = buf.rsplit(',')
                size = string.atol(l[2])
                try:
                    buf = l[0] + ',' + l[1] + ',' + str(fsize) + ',\n'
                    DRDFSLog.debug("write to meta file %s" % buf)
                    
                    os.ftruncate(fd, len(buf))
                    os.lseek(fd, 0, os.SEEK_SET)
                    os.write(fd, buf)
                    os.fsync(fd)
                except os.error, e:
                    print "OSError in release (%s)" %(e)
开发者ID:laysakura,项目名称:dddfs,代码行数:29,代码来源:meta.py

示例5: mkdir

 def mkdir(self, path, mode):
     DRDFSLog.debug('path=%s mode=%o' % (path, mode))
     try:
         os.mkdir(path, mode)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例6: rename

 def rename(self, oldpath, newpath):
     DRDFSLog.debug(oldpath + ' -> ' + newpath)
     try:
         os.rename(oldpath, newpath)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例7: utime

 def utime(self, path, times):
     DRDFSLog.debug("path = %s, times = %s" % (path, times))
     try:
         os.utime(path, times)
         senddata = 0
     except os.error, e:
         senddata = e.errno
开发者ID:laysakura,项目名称:dddfs,代码行数:7,代码来源:meta.py

示例8: access

    def access(self, path, mode):
        DRDFSLog.debug("** access **" + path + str(mode))
        senddata = ["access", path, mode]

        ans = m_channel.send_recv_flow(senddata)
        if ans != True:
            return -errno.EACCES
        return 0
开发者ID:nukamu,项目名称:dddfs,代码行数:8,代码来源:fs.py

示例9: readdir

 def readdir(self, path):
     DRDFSLog.debug('path=%s' % (path))
     try:
         l = os.listdir(path)
         senddata = [0, l]
     except os.error, e:
         senddata = [e.errno, "null"]
         print 'error!'
开发者ID:laysakura,项目名称:dddfs,代码行数:8,代码来源:meta.py

示例10: getattr

 def getattr(self, path):
     DRDFSLog.debug('path = ' + path)
     try:
         st = os.lstat(path)
     except os.error, e:
         DRDFSLog.debug("stat error!")
         senddata = [e.errno, "null"]
         self.c_channel.send_header(senddata)
         return
开发者ID:laysakura,项目名称:dddfs,代码行数:9,代码来源:meta.py

示例11: access

 def access(self, path, mode):
     DRDFSLog.debug('path=%s' % (path))
     try:
         if os.access(path, mode) == True:
             senddata = True
         else:
             senddata = False
     except os.error, e:
         senddata = False
开发者ID:laysakura,项目名称:dddfs,代码行数:9,代码来源:meta.py

示例12: run

 def run(self,):
     while True:
         daemons_alive = threading.enumerate()
         for d in self.daemons:
             if d not in daemons_alive:
                 d.join()
                 DRDFSLog.debug("** join thread **")
                 self.daemons.remove(d)
         time.sleep(3)
开发者ID:nukamu,项目名称:dddfs,代码行数:9,代码来源:fs.py

示例13: readdir

    def readdir(self, path, offset):
        DRDFSLog.debug("** readdir **" + path + str(offset))
        senddata = ["readdir", path]

        ans = m_channel.send_recv_flow(senddata)
        l = [".", ".."]
        if ans[0] == 0:
            l.extend(ans[1])
            return [fuse.Direntry(ent) for ent in l]
        else:
            return -ans[0]
开发者ID:nukamu,项目名称:dddfs,代码行数:11,代码来源:fs.py

示例14: getattr

    def getattr(self, path):
        DRDFSLog.debug("** getattr ** path = %s" % path)
        senddata = ["getattr", path]

        ans = m_channel.send_recv_flow(senddata)
        if ans[0] != 0:
            return -ans[0]
        else:
            st = tips.DRDFSStat()
            st.load(ans[1])
            if ans[2] >= 0:
                st.chsize(ans[2])
        return st
开发者ID:nukamu,项目名称:dddfs,代码行数:13,代码来源:fs.py

示例15: read

        def read(self, length, offset):
            DRDFSLog.debug("** read ** offset %d, length =%d" % (offset, length))
            requestl = self.cal_bl(offset, length)
            # prepare buffer to return
            ret_str = cStringIO.StringIO()
            DRDFSLog.debug("requestl = %s, with offset: %d, length: %d" % (str(requestl), offset, length))
            for req in requestl:
                reqbl = req[0]
                buf = ""  # buffer for block[reqbl]
                last_readbl = reqbl

                if self.bldata[reqbl].state == 2:
                    buf = self.bldata[reqbl].buf
                elif self.bldata[reqbl].state == 1:
                    DRDFSLog.debug("Waiting recv data %d block" % reqbl)
                    while self.bldata[reqbl].state == 1:
                        time.sleep(0.01)
                    buf = self.bldata[reqbl].buf
                else:
                    ret = self.request_block(reqbl)
                    if ret != 0:
                        DRDFSLog.error("read error! (%d)" % ret)
                        return ret
                    while self.bldata[reqbl].state == 1:
                        time.sleep(0.01)
                    with self.r_buflock:
                        buf = self.bldata[reqbl].buf

                # write strings to return and if reach EOF, break
                ret_str.write(buf[req[1] : req[2]])
                if len(buf) < conf.blsize:
                    break  # end of file

            return ret_str.getvalue()
开发者ID:nukamu,项目名称:dddfs,代码行数:34,代码来源:fs.py


注:本文中的libs.system.DRDFSLog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。