Changes in tools/mkfat.py [28f4adb:042fbe0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/mkfat.py
r28f4adb r042fbe0 190 190 parts = name.split('.') 191 191 192 if (len(parts) > 0):192 if len(parts) > 0: 193 193 fname = parts[0] 194 194 else: 195 195 fname = '' 196 196 197 if len(fname) > 8: 198 sys.stdout.write("mkfat.py: error: Directory entry " + name + 199 " base name is longer than 8 characters\n") 200 sys.exit(1); 201 197 202 return (fname + ' ').upper()[0:8] 198 203 … … 201 206 parts = name.split('.') 202 207 203 if (len(parts) > 1):208 if len(parts) > 1: 204 209 ext = parts[1] 205 210 else: 206 211 ext = '' 212 213 if len(parts) > 2: 214 sys.stdout.write("mkfat.py: error: Directory entry " + name + 215 " has more than one extension\n") 216 sys.exit(1); 217 218 if len(ext) > 3: 219 sys.stdout.write("mkfat.py: error: Directory entry " + name + 220 " extension is longer than 3 characters\n") 221 sys.exit(1); 207 222 208 223 return (ext + ' ').upper()[0:3] … … 211 226 dir_entry = xstruct.create(DIR_ENTRY) 212 227 213 dir_entry.name = mangle_fname(name) 214 dir_entry.ext = mangle_ext(name) 228 dir_entry.name = mangle_fname(name).encode('ascii') 229 dir_entry.ext = mangle_ext(name).encode('ascii') 215 230 216 231 if (directory): … … 239 254 240 255 dir_entry.signature = 0x2e 241 dir_entry.name = ' '242 dir_entry.ext = ' '256 dir_entry.name = b' ' 257 dir_entry.ext = b' ' 243 258 dir_entry.attr = 0x10 244 259 … … 258 273 259 274 dir_entry.signature = [0x2e, 0x2e] 260 dir_entry.name = ' '261 dir_entry.ext = ' '275 dir_entry.name = b' ' 276 dir_entry.ext = b' ' 262 277 dir_entry.attr = 0x10 263 278 … … 370 385 reserved_clusters = 2 371 386 372 # Make sure the filesystem is large enough tfor FAT16387 # Make sure the filesystem is large enough for FAT16 373 388 size = subtree_size(path, cluster_size, dirent_size) + reserved_clusters * cluster_size + extra_bytes 374 389 while (size // cluster_size < fat16_clusters):
Note:
See TracChangeset
for help on using the changeset viewer.