base.Refresh ();
}
+ [Obsolete ("The return type will change to Mono.Unix.Native.Dirent[] in the next release")]
public Dirent[] GetEntries ()
{
IntPtr dirp = Syscall.opendir (FullPath);
return (Dirent[]) entries.ToArray (typeof(Dirent));
}
+ [Obsolete ("The return type will change to Mono.Unix.Native.Dirent[] in the next release")]
public Dirent[] GetEntries (Regex regex)
{
IntPtr dirp = Syscall.opendir (FullPath);
return (Dirent[]) entries.ToArray (typeof(Dirent));
}
+ [Obsolete ("The return type will change to Mono.Unix.Native.Dirent[] in the next release")]
public Dirent[] GetEntries (string regex)
{
Regex re = new Regex (regex);
Regex re = new Regex (regex);
return GetFileSystemEntries (re);
}
+
+ public static string GetCurrentDirectory ()
+ {
+ StringBuilder buf = new StringBuilder (16);
+ IntPtr r = IntPtr.Zero;
+ do {
+ buf.Capacity *= 2;
+ r = Syscall.getcwd (buf, (ulong) buf.Capacity);
+ } while (r == IntPtr.Zero && Syscall.GetLastError() == Error.ERANGE);
+ if (r == IntPtr.Zero)
+ UnixMarshal.ThrowExceptionForLastError ();
+ return buf.ToString ();
+ }
+
+ public static void SetCurrentDirectory (string path)
+ {
+ int r = Syscall.chdir (path);
+ UnixMarshal.ThrowExceptionForLastErrorIf (r);
+ }
}
}