--- Begin Message ---
Tim Golden wrote:

[Neil Benn]
| I'm running a program which is using | shutil.copyfileobj on a Win2K Pro, python 2.3 box.


Just for (possible) reassurance, I've just
run the following code snippet on my Win2k
Python 2.3.4 box and it seemed to work
without adding any oddities to the file name. I'm copying to a "real" Windows file share, not
a Samba box, so it may make a difference.


<code>
import shutil

f = open ("test.py", "rt")
g = open (r"\\tdi_nt4a\user\goldent\temp\test.py", "wt")
try:
 shutil.copyfileobj (f, g)
finally:
 f.close ()
 g.close ()

</code>



<snip>

Hello,

Sorry for the typo, the source was opened as 'w+' and the dest was opened as 'w'. I was going from a source on the local hard drive to a samba server and getting a .read at the end. When I do this on the local hard drive, the files are copied. I was doing something like

OPEN SOURCE IN WRITE
OPEN DEST IN WRITE
WRITE TO SOURCE
FLUSH SOURCE
SEEK SOURCE to BYTE 0
COPY SOURCE TO DEST
CLOSE SOURCE
CLOSE DEST

This works on a local hard drives with no problems, therefore I have a feeling that it is something to do do with my setup here. However I'm working on a test example that I can post, currently my server is slapping me so I'll get the test code when it calms down!

   Thanks for the reply.

Cheers,

Neil

--

Neil Benn
Senior Automation Engineer
Cenix BioScience
BioInnovations Zentrum
Tatzberg 47
D-01307
Dresden
Germany

Tel : +49 (0)351 4173 154
e-mail : [EMAIL PROTECTED]
Cenix Website : http://www.cenix-bioscience.com



--- End Message ---
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to