in reply to Re: Re: How to determine a file's type via stat()
in thread How to determine a file's type via stat()

draconis,
robartes has pointed you in the right direction. Read the docs on stat.

You can import symbolic mode constants (S_IF*) and functions (S_IS*) from the Fcntl module:
S_IFREG S_IFDIR S_IFLNK S_IFBLK S_ISCHR S_IFIFO S_IFSOCK S_IFWHT S_ENFMT

Figure the bitwise math out and create a hash lookup.

Cheers - L~R

  • Comment on Re: Re: Re: How to determine a file's type via stat()