By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,089 Members | 2,418 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,089 IT Pros & Developers. It's quick & easy.

Is os.lstat available on all platforms?

P: n/a
Hi there.
In a code of mine I'd like to use os.lstat whenever possible.
My only concern is if it's available on all platforms.
It could be safe using always os.lstat instead of:

try:
os.lstat
except AttributeError:
os.stat

....?
As far as I know where symlinks are not supported os.lstat should be
an alias for os.stat but I'm not 100% sure.
Nov 29 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Giampaolo Rodola' wrote:
As far as I know where symlinks are not supported os.lstat should be
an alias for os.stat but I'm not 100% sure.
You are right, it should be an alias. os.lstat is available on Windows, too.

Christian

Nov 29 '07 #2

P: n/a
I'd just want to be sure that even on a strange python implementation
I won't ever get an AttributeError exception because os.lstat is not
defined.
Nov 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.