stat64()--Get File Information (Large File Enabled)


  Syntax
 #include <sys/stat.h>

 int stat64(const char *path, struct stat64 *buf);  
  Service Program Name: QP0LLIB1

  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes.

The stat64() function gets status information about a specified file and places it in the area of memory pointed to by the buf argument.

If the named file is a symbolic link, stat64() resolves the symbolic link. It also returns information about the resulting file.

stat64() is enabled for large files. It is capable of operating on files larger than 2GB minus 1 byte and returning correct sizes.

For additional information about authorities required, error conditions, and examples, see stat()--Get File Information.


Parameters

path
(Input) A pointer to the null-terminated path name of the file from which information is required.

This parameter is assumed to be represented in the CCSID (coded character set identifier) currently in effect for the job. If the CCSID of the job is 65535, this parameter is assumed to be represented in the default CCSID of the job.

See QlgStat64()--Get File Information (large file enabled and using NLS-enabled path name) for a description and an example of supplying the path in any CCSID.


buf
(Output) A pointer to the area to which the information should be written.

The information is returned in the following stat64 structure, as defined in the <sys/stat.h> header file:

Values of time_t are given in terms of seconds since a fixed point in time called the Epoch.

You can examine properties of a mode_t value from the st_mode field using a collection of macros defined in the <sys/stat.h> header file. If mode is a mode_t value, then:

S_ISBLK(mode)
Is nonzero for block special files
S_ISCHR(mode)
Is nonzero for character special files
S_ISDIR(mode)
Is nonzero for directories
S_ISFIFO(mode)
Is nonzero for pipes and FIFO special files
S_ISREG(mode)
Is nonzero for regular files
S_ISLNK(mode)
Is nonzero for symbolic links
S_ISSOCK(mode)
Is nonzero for local sockets
S_ISNATIVE(mode)
Is nonzero for operating system native objects

Usage Notes

  1. When you develop in C-based languages, the prototypes for the 64-bit APIs are normally hidden. To use either the stat64() API or the QlgStat64() API and the struct stat64 data type, you must compile the source with _LARGE_FILE_API defined.
  2. Start of change When you develop in C-based languages and this function is compiled with _64_BIT_TIME defined, it will be mapped to stat64_time64(). This mapping will occur whether or not _LARGE_FILES is also defined. Note that the type of the buffer parameter, struct stat *, also will be mapped to type struct stat64_time64 *. See stat64_time64() for more information about this structure. End of change

  3. All of the usage notes for stat() also apply to stat64() and to QlgStat64(). See Usage Notes in the stat() API.

API introduced: V4R4

[ Back to top | UNIX-Type APIs | APIs by category ]