Rev 3403 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3403 | Rev 3561 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | 32 | ||
33 | import sys |
33 | import sys |
34 | import os |
34 | import os |
35 | import xstruct |
35 | import xstruct |
36 | 36 | ||
- | 37 | exclude_names = set(['.svn']) |
|
- | 38 | ||
37 | HEADER = """little: |
39 | HEADER = """little: |
38 | char tag[5] /* 'TMPFS' */ |
40 | char tag[5] /* 'TMPFS' */ |
39 | """ |
41 | """ |
40 | 42 | ||
41 | DENTRY_NONE = """little: |
43 | DENTRY_NONE = """little: |
Line 68... | Line 70... | ||
68 | "Recursive directory walk" |
70 | "Recursive directory walk" |
69 | 71 | ||
70 | for name in os.listdir(root): |
72 | for name in os.listdir(root): |
71 | canon = os.path.join(root, name) |
73 | canon = os.path.join(root, name) |
72 | 74 | ||
73 | if (os.path.isfile(canon)): |
75 | if (os.path.isfile(canon) and (not name in exclude_names)): |
74 | size = os.path.getsize(canon) |
76 | size = os.path.getsize(canon) |
75 | 77 | ||
76 | dentry = xstruct.create(DENTRY_FILE % len(name)) |
78 | dentry = xstruct.create(DENTRY_FILE % len(name)) |
77 | dentry.kind = TMPFS_FILE |
79 | dentry.kind = TMPFS_FILE |
78 | dentry.fname_len = len(name) |
80 | dentry.fname_len = len(name) |
Line 87... | Line 89... | ||
87 | data = inf.read(4096); |
89 | data = inf.read(4096); |
88 | outf.write(data) |
90 | outf.write(data) |
89 | rd += len(data) |
91 | rd += len(data) |
90 | inf.close() |
92 | inf.close() |
91 | 93 | ||
92 | if (os.path.isdir(canon)): |
94 | if (os.path.isdir(canon) and (not name in exclude_names)): |
93 | dentry = xstruct.create(DENTRY_DIRECTORY % len(name)) |
95 | dentry = xstruct.create(DENTRY_DIRECTORY % len(name)) |
94 | dentry.kind = TMPFS_DIRECTORY |
96 | dentry.kind = TMPFS_DIRECTORY |
95 | dentry.fname_len = len(name) |
97 | dentry.fname_len = len(name) |
96 | dentry.fname = name |
98 | dentry.fname = name |
97 | 99 |