This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stat() and tilde prefix (was bad bash tab completion)


On Mon, Jan 14, 2013 at 04:21:25PM +1100, Shaddy Baddah wrote:
>In investigating this, I believe the issue I am having is due to how
>stat() handles tilde prefixed paths. On linux we see:
>
>linux$ $ python -c 'import os; print os.stat("~/..")'
>Traceback (most recent call last):
>   File "<string>", line 1, in <module>
>OSError: [Errno 2] No such file or directory: '~/..'
>
>and on cygwin we see:
>
>cygwin$ python -c 'import os; print os.stat("~/..")'
>posix.stat_result(st_mode=16832, st_ino=562949953496729L, 
>st_dev=4174909669L, st_nlink=1, st_uid=42037, st_gid=10513, st_size=0L, 
>st_atime=1357616166, st_mtime=1357616166, st_ctime=1357616166)

It is a bug.  It's not just "~".  Any nonexistent directory will
work, like "foo/..".

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]