[Mono-list] Symbolic Links

Chris Howie cdhowie at gmail.com
Sun Nov 9 23:59:18 EST 2008


On Sun, Nov 9, 2008 at 11:58 PM, Chris Howie <cdhowie at gmail.com> wrote:
> On Wed, Nov 5, 2008 at 6:09 PM, cce32 <cce32 at yahoo.com> wrote:
>> Currently I develop in Visual Studio 2008 and run on Linux.
>>
>> It appears directoryInfo.GetFiles("*", SearchOption.AllDirectories) returns
>> a FileInfo instance for both files and symlinks.  In other words I get
>> duplicates.
>>
>> Is there any portable way to determine if a file is a symlink?  Or to ignore
>> symlinks with GetFiles?
>
> Since Windows doesn't have any notion of a symlink, it's not likely
> that there will be any such mechanism in the MS runtime.  On
> Linux/Unix systems though, you can just use Mono.Posix to make this
> determination.  I believe Mono.Posix is released as MIT/X11 so you
> could distribute it with your app and its methods will probably just
> throw exceptions on Windows.

Ack, I hit send too fast.  Mono.Posix is deprecated, so use Mono.Unix instead.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers


More information about the Mono-list mailing list