On 8/23/2010 14:26, LRN wrote:
> On 23.08.2010 8:40, JonY wrote:
>> On 8/23/2010 11:11, Patrick Marsh wrote:
>>> Thanks for the suggestions, Jon!
>>> Changing lstat to stat seemed to work, however defining S_ISLNK to be
>>> 0 didn't. I shouldn't be surprised. Thanks for the suggestion,
>> you can remove S_ISLNK entirely as well, since Windows doesn't have that
>> sort of Unix symlinks.
> Not true. Since WINVER 6 (Vista) symlinks are available, and they are
> compatible with *nix symlinks (to some extent; see Wikipedia for
> details). API, however, does not match the *nix API for symlinks - no
> lstat(), symlink(), readlink(), link(), S_ISSLNK; and other CRT
> functions might not work with symlinks the way they do on
> POSIX-compilant systems. But that doesn't stop you from implementing
> such interface on top of WinAPI functions for symlinks and hardlinks. I
> did that (google for libntlink), and other people did too (Python 3.2
> will have symlink support on Windows>= 6; Far Manager supports all kind
> of links, etc).
Vista/7 does have symlinks, but as I have said, they're not entirely
similar to Unix where lstat/stat should be concerned.
Then again, it depends on what your app is trying to do, removing the
symlink check entirely is a lazy way to do porting you don't care about it.