[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Unix File IO

From: Rhys Weatherley
Subject: Re: [DotGNU]Unix File IO
Date: Sat, 13 Dec 2003 07:12:56 +1000
User-agent: KMail/1.4.3

On Saturday 13 December 2003 12:48 am, Brett L Trotter wrote:

> 1) File/Directory.SetCreationTime: from what I know, you have to do a
> direct filesystem write to change the ctime of an inode. Will this ever be
> supported?

It will be supported, in that the API will be available, but it won't do 
anything when called.  There's no way around this while remaining secure and 
portable.  Right now, it throws an exception to say "I can't do that!", but 
we could change that to just quietly succeed instead.

> 2) File/Directory.Set/GetAttributes: On windows VS.NET,
> File.GetAccessTime/LastWriteTime/etc work on both files and directories. In
> dotGNU, this is not true, one must call the specific function for either
> dir or file. Is this due to MS ignoring ECMA spec or something else?

If you look at the code in pnetlib's "File" and "Directory" classes, you will 
notice that they both ultimately call the same method in "FileMethods".  i.e. 
they are interchangable.  So I don't know where you are getting the idea that 
you have to use the specific method in DotGNU.

GetAttributes/SetAttributes aren't implemented yet, but we can fix that fairly 
quickly if Savannah ever comes back.  Please log a bug when the database is 
available once more.

> 3) In my backup application i wanted to set/get unix file permissions. So i
> wrote a crude hack using System.Diagnostics to execute stat and parse the
> results and some methods for processing unix permissions into a struct and
> back to integer representation (700, 655, etc). All those things were
> simple. I think my methods for the unix permissions might be of use to
> someone, but I would want to use PInvoke or other methods to get the stat
> information more directly. I could use a little help with this. Likewise, i
> wrote code to use chmod, chgrp, and chown to set the permissions and
> ownership. Is there a way dotGNU can support these kinds of filesystem
> calls more directly?

Not without breaking the the API specification.  I did break it a little to 
support symbolic links a while back, but I'm still debating as to whether 
that is a good idea or not.  I may still remove it, or shift it elsewhere.  
So, it is possible, but I suggest using PInvoke for now.

> 4) Directory.CreateDirectory(). I seem to get Permission denied creating
> directories in places I know i can write. And writing a system diagnostics
> call to mkdir -p works brilliantly in place of the
> directory.createdirectory code. Am i doing something wrong?

You'll have to give us a test case for this.

> 5) FileInfo().Length. I cannot seem to get the file size in unix using this
> method. I ended up using my stats call for that as well.

Like GetAttributes, this isn't implemented in the engine yet.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]