source: mainline/tools/filldir.py@ 77578e8

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"""
9Fill a directory with N empty directories
10"""
11
12import sys
13import os
14import os.path
15
16if len(sys.argv) < 3:
17 print('Usage: filldir <parent-dir> <count>')
18 exit(2)
19
20parent = sys.argv[1]
21num = int(sys.argv[2])
22
23i = 0
24while 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.