blob: c8ccc7d04fd21c95e8f880c5e8ed40d0d5de004d (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import subprocess
def find(basedir, **flags) -> list[bytes]:
cmdline = ['find', basedir]
for key, value in flags.items():
cmdline += [f'-{key}', value]
cmdline.append('-print0')
cmd = subprocess.run(cmdline, capture_output=True)
return cmd.stdout.split(b'\0')[:-1]
|