Build error Python 2.4.1 - stat problem?

Donn Cave donn at u.washington.edu
Tue May 24 13:29:26 EDT 2005


In article <mailman.56.1116946912.18027.python-list at python.org>,
 <Servatius.Brandt at fujitsu-siemens.com> wrote:
...
> I used the python executable from the build directory to run the
> following program:
> 
>     import os
> 
>     def main():
>         if not (os.path.exists("/")):
>             print "/ does not exist"
>         else:
>             print "/ exists"
>         if not (os.path.isdir("/")):
>             print "/ is not a directory"
>         else:
>             print "/ ok"
>     
>     if   name   == "  main  ":
>         main()
> 
> The output is:
> 
>     / exists
>     / is not a directory
> 
> It's the same for every (existing) directory name I try: os.path.isdir()
> always returns false.
> 
> It looks as if the stat results are not recognised: os.path.exists()
> works, but all the functions os.path.isdir(), os.path.isfile() etc.
> don't.
> 
> Could anyone help me to solve the problem?

Unless there are other Reliant users here ahead of you, some
of it is going to be up to you.  If you follow isdir() back,
you'll find some hard-coded octal bitmask definitions, including
S_IFDIR = 0040000.

Check it out.  Try to use that value the way they're using it,
in C and in Python, and print out all the values involved.
At worst, if C comes out wrong too, you may have a question
that the vendor will be more likely to respond to.

   Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list