[Mono-dev] System.IO or Mono.Unix
lnc19 at hotmail.com
Fri Dec 22 14:17:58 EST 2006
Thanks to you and jonathan.
You are right, i don't need (at this moment) any native calls, maybe in the
future i will use mixed solution. i was thinking that maybe it was faster
Mono.Unix than System.IO.
>From: David Brown <mono at davidb.org>
>To: Luciano _ <lnc19 at hotmail.com>
>CC: mono-devel-list at lists.ximian.com
>Subject: Re: [Mono-dev] System.IO or Mono.Unix
>Date: Fri, 22 Dec 2006 10:58:19 -0800
>Received: from mail.davidb.org ([18.104.22.168]) by
>bay0-mc9-f7.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Fri, 22
>Dec 2006 10:59:05 -0800
>Received: from a64.davidb.org ([22.214.171.124])by mail.davidb.org with
>esmtpa (Exim 4.62 #1 (Debian))id 1Gxpb1-0000w0-Lx; Fri, 22 Dec 2006
>User-Agent: Thunderbird 126.96.36.199 (X11/20061111)
>References: <BAY104-F2852C145873C97683B442EA6CD0 at phx.gbl>
>Return-Path: mono at davidb.org
>X-OriginalArrivalTime: 22 Dec 2006 18:59:06.0315 (UTC)
>Luciano _ wrote:
> > First: I'm developing an application that use System.IO and i read that
> > there are some IO operation classes in the Mono.Unix namespace. Which
> > best solution? System.IO or Mono.Unix? I'm developing a Linux-Only
> > Application.
>The simple answer would be: does your application depend on knowledge of
>the specifics of Linux or Unix filesystem semantics? If so, you should use
>the native calls. Otherwise, use the portable calls.
>For example, writing Linux backup software would definitely need to use the
>Mono.Unix calls, since the program needs to accurately backup the
> > Second: Could someone explain (example) how
> > Mono.Unix.DirectoryInfo.GetEntries works? i need to get all the
> > directories/files/symbolic links and: length, datetime creation and
> > modified, fullpath, etc. I don't understand how to use the returned
> > (Mono.Unix.Native.Dirent) and how to convert to UnixFileInfo or
> > UnixSymbolicLinkInfo.
>The only portable field in the Dirent is d_name, which will give you a
>string. Use Mono.Unix.Native.lstat to get the rest of the information.
>The names UnixSymbolicLinkInfo and UnixFileInfo are kind of misleading. I
>personally think that wrapper is more confusing than it is worth. The
>lstat will fill in a Mono.Unix.Native.Stat which will have what you want.
>Remember, you might need the routines in Mono.Unix.Marshal to convert the
>Posix time fields to something useful in the rest of Mono. I have not had
>success doing these conversions without confusion between localtime and
>The question you are asking suggests you need to use the native calls.
Visita MSN Latino Entretenimiento: ¡música, cine, chismes, TV y más...!
More information about the Mono-devel-list