64 |
|
|
65 |
def carbonfile2string(cfile): |
def carbonfile2string(cfile): |
66 |
"""Convert CarbonFile data to a string suitable for storing.""" |
"""Convert CarbonFile data to a string suitable for storing.""" |
67 |
|
if not cfile: return "None" |
68 |
retvalparts = [] |
retvalparts = [] |
69 |
retvalparts.append('creator:%s' % binascii.hexlify(cfile['creator'])) |
retvalparts.append('creator:%s' % binascii.hexlify(cfile['creator'])) |
70 |
retvalparts.append('type:%s' % binascii.hexlify(cfile['type'])) |
retvalparts.append('type:%s' % binascii.hexlify(cfile['type'])) |
108 |
|
|
109 |
# If there is Carbon data, save it. |
# If there is Carbon data, save it. |
110 |
if rorpath.has_carbonfile(): |
if rorpath.has_carbonfile(): |
111 |
if not rorpath.get_carbonfile(): cfile = "None" |
cfile = carbonfile2string(rorpath.get_carbonfile()) |
|
else: cfile = carbonfile2string(rorpath.get_carbonfile()) |
|
112 |
str_list.append(" CarbonFile %s\n" % (cfile,)) |
str_list.append(" CarbonFile %s\n" % (cfile,)) |
113 |
|
|
114 |
# If file is hardlinked, add that information |
# If file is hardlinked, add that information |