ホーム » 2013 » 8月 » 10

日別アーカイブ: 2013/08/10

2013年8月
 123
45678910
11121314151617
18192021222324
25262728293031

カテゴリー

アーカイブ

ブログ統計情報

  • 80,198 アクセス



open で errno = 13

ファイルにより,open で errno に 13 EACCES Permission denied が設定される.
  bool Get_fstat (LPCTSTR name,struct stat* fs) {
    if (fs == NULL) { return false ; }
    int fh = _topen(name,O_RDONLY) ;
    if (fh < 0) { i_Dump(errno) ; }
    if (fh < 0) { return false ; }
    memset(fs,0,sizeof(struct stat)) ;
    int ret = fstat(fh,fs) ;
    _close(fh) ;
    return (ret == 0) ;
    }
__FILE__ などは期待した動作だが,c:\pagefile.sys でエラーとなった.


VC 6 では,~\VC98\CRT\SRC\OPEN.C で CreateFile を呼出している.
その時の値は,
fileaccess 0x80000000
fileattrib 0x00000080
filecreate 0x00000003
fileshare 0x00000003
osfh 0x0013fef0
+ path 0x000326d1 “c:\pagefile.sys”
+ &SecurityAttributes 0x0013fdbc

Is this 投稿 useful? Useful Useless 0 of 0 people say this 投稿 is useful.