File: copyfile.py

package info (click to toggle)
libpeas 1.30.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 2,244 kB
  • sloc: ansic: 12,160; python: 204; xml: 44; sh: 32; makefile: 18
file content (15 lines) | stat: -rw-r--r-- 324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3

# Replace calls to 'cp' with Python

import shutil
import sys

if len(sys.argv) < 3:
    raise ValueError('Usage: %s <srcfiles> <destfile>' % sys.argv[0])

last_arg_index = len(sys.argv) - 1
destdir = sys.argv[last_arg_index]

for x in range(1, last_arg_index):
    shutil.copy(sys.argv[x], destdir)