[python-win32] wrong results in service running mode

Michael Li mli at deform.com
Thu Apr 20 00:13:29 CEST 2006


Hi,

I have a python program running 24x7.

One piece of the program is to check a file exist or not as follows:

         szNormPath= os.path.normpath(strFileName)
         nRetCode = os.access(szNormPath, os.F_OK)
         # nRetCode = os.path.exists(szNormPath)

When the file path is C:\shared\t.txt, no problem.
When the path becomes L:\t.txt, then I got problems:
nRetCode always is False(0), here L: is a mapped drive
L: = C:\shared. So L:\t.txt and C:\shared\t.txt
point to the same file.

The strange thing is that when I run the python program
in a DOS Window, I don't have the above problem, that is,
nRetCode always is True(1) for L:\t.txt.

The above strange thing happened at one computer,
the "L:" can be at another computer,  let's say I have two
computers, computer 2 maps computer 1 C:\shared as L:,
L: = \\computer 1\shared, if the python program runs on
computer 1 in service mode, nRetCode always is False(0),
if the python program runs on DOS window of computer 1,
nRetCode always is True(1).

How do I solve the problem ?

What else function I should use ?

I am using  python2.3.

best regards.
Michael li



==========
This email message and any attachments are for the sole use of the intended recipients and may contain proprietary and/or confidential information which may be privileged or otherwise protected from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipients, please contact the sender by reply email and destroy the original message and any copies of the message as well as any attachments to the original message.



More information about the Python-win32 mailing list