[Mono-list] Mono.Unix inside Mono.Posix?

Bob Portmann bportmann at yahoo.com
Wed Aug 10 13:33:51 EDT 2005


I've started using the classes in the Mono.Unix and have noticed
something strange about them.  One must include the Mono.Posix
assembly instead of the expected (by me) Mono.Unix as demonstrated by
this simple test case:

prompt> cat test.cs 
using System;
using Mono.Unix;

public class Test 
{
  public static void Main (string[] args)
  {
    string currentDir = UnixDirectory.GetCurrentDirectory ();
    Console.WriteLine ("Current Directory = {0}", currentDir);
  }
}

prompt> mcs -r:Mono.Unix test.cs
error CS0006: Cannot find assembly `Mono.Unix'
Log: 
Compilation failed: 1 error(s), 0 warnings

prompt> mcs -r:Mono.Posix test.cs
prompt> mono test.exe
Current Directory = /Users/me/src/Messages

This is non-intuitive and took me a bit to figure out (I had to
download the source code to find that Mono.Unix is in the Mono.Posix
directory).  Monodoc shows both of these assemblies to be at the same
level so I would expect the first method above to work.

Is this a bug or am I just being dense?

Question 2: Actually, the only method I need (so far) is 
Mono.Unix.access to find out if a file has read access.  Is there a 
way to find this out using a method in System.



		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


More information about the Mono-list mailing list