parent
8ac89b7be9
commit
4dc6b6ccab
5 changed files with 39 additions and 20 deletions
@ -1,6 +1,7 @@ |
|||||||
#!/usr/bin/env python3 |
#!/usr/bin/env python3 |
||||||
|
|
||||||
import sys |
import sys |
||||||
|
from pathlib import Path |
||||||
|
|
||||||
with open(sys.argv[2], 'w') as f: |
Path(sys.argv[2]).write_text( |
||||||
print('int func{n}(void) {{ return {n}; }}'.format(n=sys.argv[1]), file=f) |
'int func{n}(void) {{ return {n}; }}'.format(n=sys.argv[1])) |
||||||
|
@ -1,5 +1 @@ |
|||||||
int main(int argc, char **argv) { |
int main(void) { return 0; } |
||||||
(void) argc; |
|
||||||
(void) argv; |
|
||||||
return 0; |
|
||||||
} |
|
||||||
|
@ -0,0 +1,23 @@ |
|||||||
|
#!/usr/bin/env python3 |
||||||
|
""" |
||||||
|
generate sequence of filename that does not exceed MAX_LEN=260 |
||||||
|
for Python < 3.6 and Windows without modified registry |
||||||
|
""" |
||||||
|
|
||||||
|
import sys |
||||||
|
import string |
||||||
|
|
||||||
|
name_len = 260 - len(sys.argv[2]) - 4 - 39 - 4 - 2 |
||||||
|
if name_len < 1: |
||||||
|
raise ValueError('The meson build directory pathname is so long ' |
||||||
|
'that we cannot generate filenames within 260 characters.') |
||||||
|
# leave room for suffix and file separators, and meson generated text |
||||||
|
# e.g. ".c.obj.d" and other decorators added by Meson at configuration |
||||||
|
# for intermediate files |
||||||
|
|
||||||
|
base = string.ascii_letters * 5 # 260 characters |
||||||
|
max_num_len = len(str(sys.argv[1])) |
||||||
|
base = base[: name_len - max_num_len] |
||||||
|
|
||||||
|
for i in range(int(sys.argv[1])): |
||||||
|
print("{base}{i:0{max_num_len}d}".format(base=base, max_num_len=max_num_len, i=i)) |
@ -1,6 +0,0 @@ |
|||||||
#!/usr/bin/env python3 |
|
||||||
|
|
||||||
import sys |
|
||||||
|
|
||||||
for i in range(int(sys.argv[1]), int(sys.argv[2])): |
|
||||||
print(i) |
|
Loading…
Reference in new issue