Stat Functions

Overview

// typedefs

typedef struct apr_finfo_t apr_finfo_t;

// structs

struct apr_finfo_t;

// global functions

apr_status_t
apr_stat(
    apr_finfo_t* finfo,
    const char* fname,
    apr_int32_t wanted,
    apr_pool_t* pool
);

// macros

#define APR_FINFO_ATIME
#define APR_FINFO_CSIZE
#define APR_FINFO_CTIME
#define APR_FINFO_DEV
#define APR_FINFO_DIRENT
#define APR_FINFO_GPROT
#define APR_FINFO_GROUP
#define APR_FINFO_ICASE
#define APR_FINFO_IDENT
#define APR_FINFO_INODE
#define APR_FINFO_LINK
#define APR_FINFO_MIN
#define APR_FINFO_MTIME
#define APR_FINFO_NAME
#define APR_FINFO_NLINK
#define APR_FINFO_NORM
#define APR_FINFO_OWNER
#define APR_FINFO_PROT
#define APR_FINFO_SIZE
#define APR_FINFO_TYPE
#define APR_FINFO_UPROT
#define APR_FINFO_USER
#define APR_FINFO_WPROT

Detailed Documentation

Typedefs

typedef struct apr_finfo_t apr_finfo_t

file info structure

Global Functions

apr_status_t
apr_stat(
    apr_finfo_t* finfo,
    const char* fname,
    apr_int32_t wanted,
    apr_pool_t* pool
)

get the specified file’s stats. The file is specified by filename, instead of using a pre-opened file.

Note

If APR_INCOMPLETE is returned all the fields in finfo may not be filled in, and you need to check the finfo->valid bitmask to verify that what you’re looking for is there.

Parameters:

finfo

Where to store the information about the file, which is never touched if the call fails.

fname

The name of the file to stat.

wanted

The desired apr_finfo_t fields, as a bit flag of APR_FINFO_ values

pool

the pool to use to allocate the new file.

Macros

#define APR_FINFO_ATIME

Access Time

#define APR_FINFO_CSIZE

Storage size consumed by the file

#define APR_FINFO_CTIME

Creation or inode-changed time

#define APR_FINFO_DEV

Device

#define APR_FINFO_DIRENT

an atomic unix apr_dir_read()

#define APR_FINFO_GPROT

Group protection bits

#define APR_FINFO_GROUP

Group

#define APR_FINFO_ICASE

if dev is case insensitive

#define APR_FINFO_IDENT

dev and inode

#define APR_FINFO_INODE

Inode

#define APR_FINFO_LINK

Stat the link not the file itself if it is a link

#define APR_FINFO_MIN

type, mtime, ctime, atime, size

#define APR_FINFO_MTIME

Modification Time

#define APR_FINFO_NAME

->name in proper case

#define APR_FINFO_NLINK

Number of links

#define APR_FINFO_NORM

an atomic unix apr_stat()

#define APR_FINFO_OWNER

user and group

#define APR_FINFO_PROT

all protections

#define APR_FINFO_SIZE

Size of the file

#define APR_FINFO_TYPE

Type

#define APR_FINFO_UPROT

User protection bits

#define APR_FINFO_USER

User

#define APR_FINFO_WPROT

World protection bits