Reading Tapes

Peter Hansen peter at engcorp.com
Mon Aug 13 23:36:38 EDT 2001


Juan Huertas wrote:
> 
> Hi all.
> 
> My pc has a DAT tape (Windows 2000 Tape0) and i need to read the content of
> a tape with unix format, using low level I'ts possible to read from the
> device inside python?.
> 
> I try:
> 
> dat=open('\\.\Tape0','rb').read()
> 
> but the system does not open the file (ilegal file name: \\.\Tape0).

Why did you believe \.\TAPE0 was a valid file name in the first 
place?  I don't know W2K, but under previous versions of that 
operating system that file name is just equivalent to \TAPE0, 
meaning it would have to look like a file in the root directory 
(of the current drive, maybe C:, maybe not).  I'm not expert on 
tape drives under W2K, but I suspect that's not the case.
This may not be a Python question, unless you can successfully
access the drive as a file using some other program.  Can 
you just use "TYPE \\.\TAPE0" and get something?  I doubt it.

Or is this a way of referring to a shared device named \TAPE0
under the current computer (using \\. instead of \\COMPUTERNAME)?
I've never seen that before, and it isn't valid under W98.

I'm also suspicious as to whether a DAT tape under W2K would
look like a file at all.  Usually Windows tape drives end
up being available only through special device drivers to
applications which know about tapes.  *Unix* is prone to 
making all things look like files, so maybe you've taken
what was a valid path under Unix and tried to use it under
W2K?  (i.e. the original device was addressed as /./tape0 
under Unix?)  That wouldn't work either.

I don't like posting something so fundamentally unhelpful, 
but nobody else beat me to it ... :)



More information about the Python-list mailing list