Rev 3525 | Rev 3545 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3525 | Rev 3541 | ||
---|---|---|---|
Line 34... | Line 34... | ||
34 | import os |
34 | import os |
35 | import random |
35 | import random |
36 | import xstruct |
36 | import xstruct |
37 | import array |
37 | import array |
38 | 38 | ||
- | 39 | exclude_names = set(['.svn']) |
|
- | 40 | ||
39 | def align_up(size, alignment): |
41 | def align_up(size, alignment): |
40 | "Return size aligned up to alignment" |
42 | "Return size aligned up to alignment" |
41 | 43 | ||
42 | if (size % alignment == 0): |
44 | if (size % alignment == 0): |
43 | return size |
45 | return size |
Line 284... | Line 286... | ||
284 | empty_cluster = 0 |
286 | empty_cluster = 0 |
285 | 287 | ||
286 | for name in os.listdir(root): |
288 | for name in os.listdir(root): |
287 | canon = os.path.join(root, name) |
289 | canon = os.path.join(root, name) |
288 | 290 | ||
289 | if (os.path.isfile(canon)): |
291 | if (os.path.isfile(canon) and (not name in exclude_names)): |
290 | rv = write_file(canon, outf, cluster_size, data_start, fat, reserved_clusters) |
292 | rv = write_file(canon, outf, cluster_size, data_start, fat, reserved_clusters) |
291 | directory.append(create_dirent(name, False, rv[0], rv[1])) |
293 | directory.append(create_dirent(name, False, rv[0], rv[1])) |
292 | 294 | ||
293 | if (os.path.isdir(canon)): |
295 | if (os.path.isdir(canon) and (not name in exclude_names)): |
294 | rv = recursion(False, canon, outf, cluster_size, root_start, data_start, fat, reserved_clusters, dirent_size, empty_cluster) |
296 | rv = recursion(False, canon, outf, cluster_size, root_start, data_start, fat, reserved_clusters, dirent_size, empty_cluster) |
295 | directory.append(create_dirent(name, True, rv[0], rv[1])) |
297 | directory.append(create_dirent(name, True, rv[0], rv[1])) |
296 | 298 | ||
297 | if (head): |
299 | if (head): |
298 | outf.seek(root_start) |
300 | outf.seek(root_start) |