[Tutor] File mode tests
Chad Crabtree
flaxeater at yahoo.com
Fri Jul 30 04:02:40 CEST 2004
Bill Campbell wrote:
>I'm just getting my feet wet with python after programming primarily
in
>perl since perl-3.something. I've read the Harms and McDonald ``The
Quick
>Python Book'', and O'Reilly's ``Learning Python'', but haven't been
able to
>find python equivalents to these perl tests (lots of others in
os.path, but
>not these :-).
>
> if ( -x path ) # is is executable
> if ( -r path ) # is it readable
> if ( -w path ) # is it writeable
>
>I would love to find documentation, something like ``python for the
perl
>hacker'' that would help in the transition.
>
>Bill
>--
>INTERNET: bill at Celestial.COM Bill Campbell; Celestial Systems,
Inc.
>UUCP: camco!bill PO Box 820; 6641 E. Mercer Way
>FAX: (206) 232-9186 Mercer Island, WA 98040-0820; (206)
236-1676
>URL: http://www.celestial.com/
>
>``Mechanical Engineers build weapons. Civil Engineers build
targets.''
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
>
>
Well I found something interesting at the New Mexico Tech Site
http://infohost.nmt.edu/tcc/help/lang/python/pathinfo.html
has an easy object interface to your questions. Perhaps the source
will
deliver a more meaningful answer because they say it's just sugar
coating on the regular os module.
Have a good day
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
More information about the Tutor
mailing list