[Tutor] X_OK

Bob Gailer ramrom@earthling.net
Fri Nov 1 17:33:03 2002


--=====================_18998728==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 11:47 AM 11/1/2002 -0800, Bryan Weingarten wrote:

>can someone please explain to me why
>
>import os
>os.access('C:\WINNT\notepad.exe', os.X_OK)
>
>always return a 0 on a windows executable file?

Try os.access('C:\\WINNT\\notepad.exe', os.X_OK)

Remember that a single \ in a string literal is an escape character. It 
takes \\ to represent \.

Bob Gailer
170 Forsythe Rd
Nederland CO 80466
303-442-2625
--=====================_18998728==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
At 11:47 AM 11/1/2002 -0800, Bryan Weingarten wrote:<br><br>
<blockquote type=cite class=cite cite><font face="arial" size=2>can
someone please explain to me why </font><br>
&nbsp;<br>
<font face="arial" size=2>import os</font><br>
<font face="arial" size=2>os.access('C:\WINNT\notepad.exe', os.X_OK)
</font><br>
&nbsp;<br>
<font face="arial" size=2>always return a 0 on a windows executable
file?&nbsp; </font><font face="arial"></font></blockquote><br>
<font face="arial" size=2>Try os.access('C:\\WINNT\\notepad.exe',
os.X_OK) <br><br>
</font>Remember that a single \ in a string literal is an escape
character. It takes \\ to represent \.<br>
<x-sigsep><p></x-sigsep>
Bob Gailer<br>
170 Forsythe Rd<br>
Nederland CO 80466<br>
303-442-2625</html>

--=====================_18998728==_.ALT--