Last change
on this file since 77578e8 was 4dd3912, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago |
Update python scripts
|
-
Property mode
set to
100755
|
File size:
432 bytes
|
Line | |
---|
1 | #!/usr/bin/env python
|
---|
2 | #
|
---|
3 | # SPDX-FileCopyrightText: 2011 Martin Sucha
|
---|
4 | #
|
---|
5 | # SPDX-License-Identifier: BSD-3-Clause
|
---|
6 | #
|
---|
7 |
|
---|
8 | """
|
---|
9 | Fill a directory with N empty directories
|
---|
10 | """
|
---|
11 |
|
---|
12 | import sys
|
---|
13 | import os
|
---|
14 | import os.path
|
---|
15 |
|
---|
16 | if len(sys.argv) < 3:
|
---|
17 | print('Usage: filldir <parent-dir> <count>')
|
---|
18 | exit(2)
|
---|
19 |
|
---|
20 | parent = sys.argv[1]
|
---|
21 | num = int(sys.argv[2])
|
---|
22 |
|
---|
23 | i = 0
|
---|
24 | while i < num:
|
---|
25 | name = hex(i)[2:].zfill(5)
|
---|
26 | path = os.path.join(parent, name)
|
---|
27 | os.mkdir(path)
|
---|
28 | i += 1
|
---|
Note:
See
TracBrowser
for help on using the repository browser.