Exemple #1
0
 void CopyStat(FileProperty x, ref Stat s)
 {
     s.st_uid   = uid;
     s.st_gid   = gid;
     s.st_ctime = (long)(x.CreationTime - EpochBase).TotalSeconds;
     s.st_mtime = s.st_ctime;
     //s.st_mtime = (long)(x.LastWriteTime - EpochBase).TotalSeconds;
     if (x.IsFile)
     {
         s.st_mode  = FilePermissions.S_IFREG | NativeConvert.FromOctalPermissionString("0444");
         s.st_nlink = 1;
         s.st_size  = x.Size;
     }
     else
     {
         s.st_mode  = FilePermissions.S_IFDIR | NativeConvert.FromOctalPermissionString("0755");
         s.st_nlink = 2;
     }
 }
        public override Stream ReadOpen(string path, out FileProperty stat)
        {
            Entry prop;

            using (var rdlock = rwlock.ReadLock()) {
                prop = Lookup(path);
            }
            if (prop == null)
            {
                throw new FileNotFoundException();
            }
            var fileProp = prop as FileEntry;

            if (fileProp == null)
            {
                throw new IOException();
            }

            stat = fileProp;
            return(new Reader(this, fileProp));
        }
 /// <summary>指定されたパスのコンテンツを取得する</summary>
 /// <exception cref="System.ArgumentException">パスが不正</exception>
 /// <exception cref="System.ArgumentNullException">パスがNULL</exception>
 /// <exception cref="System.IO.FileNotFoundException">指定されたパスが存在しない</exception>
 /// <exception cref="System.Security.Authentication.AuthenticationException">トークンの有効期限切れ等による認証失敗</exception>
 /// <exception cref="System.UnauthorizedAccessException">オブジェクトを取得する権限がない</exception>
 /// <exception cref="System.TimeoutException">サーバとの通信でタイムアウト</exception>
 /// <exception cref="System.IO.IOException">その他のエラー</exception>
 public abstract Stream ReadOpen(string path, out FileProperty stat);