Oracle Solaris Studio 12.4 Man Pages

Exit Print View

Updated: January 2015
 
 

fstat64(3F)

Name

stat64 , lstat64 , fstat64 - 获取长文件的文件状态

Synopsis

integer*4 function stat64(name,statb)
character*(*) name
integer*8 statb(13)
integer*4 function lstat64(name,statb)
character*(*) name
integer*8 statb(13)
integer*4 function fstat64(lunit,statb)
integer*8 statb(13)

Description

这些例程返回有关文件的详细信息。

它们是对应的例程 statlstatfstat 的各种版本,利用 64 位整数状态数组返回有关长文件的信息(Solaris 2.6 和 2.7)。

函数 stat64lstat64filename 执行查询。

函数 fstat64 按 FORTRAN 逻辑单元 lunit 执行查询。

成功时,每个函数的值为零,否则返回错误代码。

变量 statb 接收文件的状态结构。

调用序列:

stat64:
integer*4 stat64
integer*8 statb(13)
character name*(*)
ierr = stat64 ( name, statb )

fstat64:
integer*4 fstat64, logunit
integer*8 statb(13)
ierr = fstat64 ( logunit, statb )

lstat64:
integer*4 lstat64
integer*8 statb(13)
character name*(*)
ierr = lstat64 ( name, statb )

数组 statb 中返回的信息的含义在 stat(2) 下针对结构 stat 的描述中有介绍。

不包括备用值。顺序为:

 
statb(1)        device inode resides on
statb(2)        this inode's number
statb(3)        protection
statb(4)        number of hard links to the file
statb(5)        user id of owner
statb(6)        group id of owner
statb(7)        the device type, for inode that is device
statb(8)        total size of file
statb(9)        file last access time
statb(10)       file last modify time
statb(11)       file last status change time
statb(12)       optimal blocksize for file system i/o ops
statb(13)       actual number of blocks allocated

注意

注意

stat64 调用 libc 库中的 stat(2),而 lstat64 则调用 lstat(2)。有关这两个 libc 函数之间的差异,请参见 stat(2) 手册页。简言之,当指定的文件是符号链接时,它们不同;lstat64 将返回有关该链接的信息,而 stat64 将返回有关该链接引用的文件的信息。

Files

libfui.a

See also

stat(2)、stat(3F)、access(3F)、perror(3F)、time(3F)

Bugs

路径名的长度不能超过 <sys/param.h> 中定义的 MAXPATHLEN