[Mono-dev] Mono.Unix - UnixDirectoryInfo.IsSymbolyicLinkquestion
jonpryor at vt.edu
Mon Oct 3 20:37:28 EDT 2005
On Tue, 2005-10-04 at 09:37 +1000, Paddy Joy wrote:
> Thanks for the background info and help, it all makes a lot more sense now.
> I'm using UnixSymbolicLinkInfo now and getting the correct results.
> So am I correct in saying that if you have a UnixDirectoryInfo object the
> IsSymbolicLink property will never be set to true because it will always
> reference the sym link target
This is correct, *unless* the filesystem encounters
UnixEnvironment.GetConfigurationValue (SysConf._SC_SYMLOOP_MAX) symbolic
links when searching for the target, in which case an error will occur
(Errno.ELOOP, which is mapped to a UnixIOException).
> Also since we are on the subject of UnixDirectoryInfo :-) Is the
> GetFileSystemEntries() method a implementation of the
> DirectoryInfo.GetDirectories() for the linux filesystem or is it something
> completly different?
UnixDirectoryInfo.GetFileSystemEntries() is a wrapper over
Syscall.opendir()/Syscall.readdir_r()/Syscall.closedir(). So it could
be considered to be an implementation of
System.IO.DirectoryInfo.GetFileSystemInfos() using the native POSIX
APIs. It's not Linux-specific, just POSIX-specific.
You might find the source interesting; it's available at:
More information about the Mono-devel-list