Accessing a file on a network drive
Hi, I'm trying to open a file from a windows network drive from a external python script in ZOPE: The operation looks like this: fh = Open('\\\\projects/subprojectname/sound/C01-1_FAS_01AS.wav','rb') I also tried: fh = Open('\\\\projects\\subprojectname\\sound\\C01-1_FAS_01AS.wav','rb') Both operation fails with this error: Error Type: IOError Error Value: [Errno 22] Invalid argument When I try the two operation above from a standalone python script everything works fine. I also tried to open a locale file from my ZOPE script example: fh = open('c:\\test.txt','rb') And this works fine too. What am I doing wrong? Best Regards Jørgen Larsen
I'm not sure if you're going to be able to use a unc \\server\share type name from within zope. Can you do it in zope by mapping / assigning a drive letter to the share (like the local file example?) that would tell you. HTH bobb ----- Original Message ----- From: "Jørgen Larsen" <jorgen.larsen@ioi.dk> To: <zope@zope.org> Sent: Wednesday, December 17, 2003 6:13 AM Subject: [Zope] Accessing a file on a network drive Hi, I'm trying to open a file from a windows network drive from a external python script in ZOPE: The operation looks like this: fh = Open('\\\\projects/subprojectname/sound/C01-1_FAS_01AS.wav','rb') I also tried: fh = Open('\\\\projects\\subprojectname\\sound\\C01-1_FAS_01AS.wav','rb') Both operation fails with this error: Error Type: IOError Error Value: [Errno 22] Invalid argument When I try the two operation above from a standalone python script everything works fine. I also tried to open a locale file from my ZOPE script example: fh = open('c:\\test.txt','rb') And this works fine too. What am I doing wrong? Best Regards Jørgen Larsen _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Jørgen Larsen wrote at 2003-12-17 12:13 +0100:
I'm trying to open a file from a windows network drive from a external python script in ZOPE:
The operation looks like this:
fh = Open('\\\\projects/subprojectname/sound/C01-1_FAS_01AS.wav','rb')
I also tried:
fh = Open('\\\\projects\\subprojectname\\sound\\C01-1_FAS_01AS.wav','rb')
Both operation fails with this error: Error Type: IOError Error Value: [Errno 22] Invalid argument
I cannot help you with Windows specific problems (fortunately, I need not to work with Windows). But, I can assure you that an External Method behaves the same as an external Python script with respect to security and file access. Thus, it cannot be Zope that causes access to fail. Maybe, some other difference (other user, other file permissions, ...). By the way: "IOError" comes directly from the operating system. Somehow, your Windows is unhappy about the access to the network file.... -- Dieter
participants (3)
-
Bobb -
Dieter Maurer -
Jørgen Larsen