simultaneous copy to multiple media

L

lannsjo

I need a program that simultaneously can copy a single file (1 GB) from
my pc to multiple USB-harddrives.

I have searched the internet and only found one program that does this
on
http://mastermind.com.pl/multicopy/

but this link doesnt work anymore???? somebody that can help me, is
there any other programs out there.
 
T

Tim Chase

I need a program that simultaneously can copy a single file (1
GB) from my pc to multiple USB-harddrives.

Sounds like a pretty simple simple python script:
-------------------------------------------------------
#!/bin/env python
def spew(source_file_name,
output_file_names,
block_size = 8*1024):
source = file(source_file_name, "rb")
output_files = [file(s, "wb") for s in output_file_names]
s = source.read(block_size)
while s:
for outfile in output_files:
outfile.write(s)
s = source.read(block_size)

for outfile in output_files:
outfile.close()
source.close()

if __name__ == '__main__':
from sys import argv
if len(argv) > 2:
spew(argv[1], argv[2:])
else: #print some usage/help
print "%s source_file dest_file1 [dest_file2 [dest_file3
[...]]]" % argv[0]
-------------------------------------------------------

Just call it with

bash> cd /mnt
bash> python spew.py file1.txt usb1/file1.txt usb2/file2.txt

for as many destinations as you want. Adjust the blocksize as
you see fit:

spew(argv[1], argv[2:], 1024*1024)

or whatever your favorite blocksize is.

It's not terribly graceful about error-checking, or prompting if
any of the files exist previously, or if it can't write to any of
the output files because for any reason (full disk,
write-protected disk, destination path doesn't exist, etc).
Thus, if there's a problem, you'll get a pretty backtrace that
will allow you to solve all your problems ;)

-tkc
 
C

Claudio Grondi

I need a program that simultaneously can copy a single file (1 GB) from
my pc to multiple USB-harddrives.

Why not just use:
copy c:\file.ext u:\file.exe
in one shell and in another
copy c:\file.ext v:\file.exe
where u: and v: are the USB drives?

There is usually not much gain on USB when on Windows, especially in
case of a single file which fits into memory (and the file cache) to do
it 'simultaneously'.
This subject was discussed here already in the past:

http://mail.python.org/pipermail/python-list/2005-March/271985.html

Claudio Grondi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,222
Messages
2,571,137
Members
47,754
Latest member
Armand37T7

Latest Threads

Top