Bug #7225 ยป 7225.py
1 |
#!/usr/bin/env python
|
---|---|
2 |
|
3 |
from __future__ import print_function |
4 |
|
5 |
import arvados |
6 |
import sys |
7 |
|
8 |
if len(sys.argv) < 2: |
9 |
print("Usage: 7225.py filename [filename ...]") |
10 |
sys.exit(2) |
11 |
|
12 |
out_coll = arvados.collection.Collection() |
13 |
for in_name in sys.argv[1:]: |
14 |
with out_coll.open(in_name, "wb") as writer, open(in_name, "rb") as reader: |
15 |
dat = reader.read(64*1024) |
16 |
while dat: |
17 |
writer.write(dat) |
18 |
dat = reader.read(64*1024) |
19 |
|
20 |
print(out_coll.manifest_text()) |