internal UnixFileSystemInfo (String path, Stat stat) { this.originalPath = path; this.fullPath = UnixPath.GetFullPath (path); this.stat = stat; this.valid = true; }
internal FileStat (string path) { buf = new Stat (); is_directory = is_regular_file = Syscall.stat (path, out buf) == 0; is_regular_file &= (buf.st_mode & FilePermissions.S_IFREG) == FilePermissions.S_IFREG; is_directory &= (buf.st_mode & FilePermissions.S_IFDIR) == FilePermissions.S_IFDIR; // FIXME: workaround for http://bugzilla.ximian.com/show_bug.cgi?id=76966 is_directory &= ! ((buf.st_mode & FilePermissions.S_IFSOCK) == FilePermissions.S_IFSOCK); mtime = buf.st_mtime; }
internal UnixFileInfo (string path, Stat stat) : base (path, stat) { }
protected override int GetFileStatus (string path, out Stat stat) { return Syscall.lstat (path, out stat); }
internal UnixSymbolicLinkInfo (string path, Stat stat) : base (path, stat) { }
public static DateTime GetLastStatusChangeTime(Stat stat) { return NativeConvert.ToDateTime(stat.st_ctime); }
public static DateTime GetLastAccessTime(Stat stat) { return NativeConvert.ToDateTime(stat.st_atime); }
public static UnixFileType GetFileType(Stat stat) { return (UnixFileType)(stat.st_mode & FilePermissions.S_IFMT); }
public static long GetFileSize(Stat stat) { return stat.st_size; }
public static DateTime GetLastWriteTime(Stat stat) { return NativeConvert.ToDateTime(stat.st_mtime); }
protected virtual int GetFileStatus (string path, out Stat stat) { return Syscall.stat (path, out stat); }
public static extern int lstat (string file_name, out Stat buf);
public static extern int fstat (int filedes, out Stat buf);
internal UnixDirectoryInfo (string path, Stat stat) : base (path, stat) { }