Example #1
0
 def getfileinfo(name):
     finfo = FSSpec(name).FSpGetFInfo()
     dir, file = os.path.split(name)
     fp = open(name, "rb")
     fp.seek(0, 2)
     dlen = fp.tell()
     fp = openrf(name, "*rb")
     fp.seek(0, 2)
     rlen = fp.tell()
     return (file, finfo, dlen, rlen)
 def getfileinfo(name):
     finfo = FSSpec(name).FSpGetFInfo()
     dir, file = os.path.split(name)
     fp = open(name, 'rb')
     fp.seek(0, 2)
     dlen = fp.tell()
     fp = openrf(name, '*rb')
     fp.seek(0, 2)
     rlen = fp.tell()
     return (file, finfo, dlen, rlen)
Example #3
0
 def getfileinfo(name):
     finfo = FSSpec(name).FSpGetFInfo()
     dir, file = os.path.split(name)
     # XXX Get resource/data sizes
     fp = open(name, 'rb')
     fp.seek(0, 2)
     dlen = fp.tell()
     fp = openrf(name, '*rb')
     fp.seek(0, 2)
     rlen = fp.tell()
     return file, finfo, dlen, rlen
Example #4
0
 def getfileinfo(name):
     finfo = FSSpec(name).FSpGetFInfo()
     dir, file = os.path.split(name)
     # XXX Get resource/data sizes
     fp = open(name, 'rb')
     fp.seek(0, 2)
     dlen = fp.tell()
     fp = openrf(name, '*rb')
     fp.seek(0, 2)
     rlen = fp.tell()
     return file, finfo, dlen, rlen
Example #5
0
def openrf(fn, *mode):
    import os
    try:
        from MacOS import openrf
    except ImportError:
        mode=list(mode)
        if mode:
            #MacOS.openrf allows and ignores asterisks.
            #One is passed by AppleSingle.py without explanation.
            #Ignore them likewise.
            mode[0]=mode[0].replace("*","")
        try:
            #NTFS under Windows and others
            return open(fn+":rsrc", *mode)
        except (EnvironmentError, SystemError):
            if (os.name=="posix") and not os.path.isdir(fn):
                #Used for HFS+ on some platform(s)
                return open(fn+"/rsrc", *mode)
            raise
    else:
        return openrf(fn, *mode)
Example #6
0
 def openrsrc(name, *mode):
     if not mode:
         mode = '*rb'
     else:
         mode = '*' + mode[0]
     return openrf(name, mode)
Example #7
0
 def openrsrc(name, *mode):
     if not mode:
         mode = '*rb'
     else:
         mode = '*' + mode[0]
     return openrf(name, mode)
Example #8
0
 def openrsrc(name, *mode):
     if not mode:
         mode = "*rb"
     else:
         mode = "*" + mode[0]
     return openrf(name, mode)