BRL-CAD
#include "common.h"
#include <string.h>
#include <ctype.h>
#include "bio.h"
#include "bu/debug.h"
#include "bu/file.h"
#include "bu/log.h"
#include "bu/str.h"
Include dependency graph for file.c:

Go to the source code of this file.

Macros

#define R_OK   4
 
#define W_OK   2
 
#define X_OK   1
 

Functions

int bu_file_exists (const char *path, int *fd)
 
int bu_same_file (const char *fn1, const char *fn2)
 
int bu_same_fd (int fd1, int fd2)
 
HIDDEN int file_access (const char *path, int access_level)
 
int bu_file_readable (const char *path)
 
int bu_file_writable (const char *path)
 
int bu_file_executable (const char *path)
 
int bu_file_directory (const char *path)
 
int bu_file_symbolic (const char *path)
 
int bu_file_delete (const char *path)
 
int bu_fseek (FILE *stream, off_t offset, int origin)
 
off_t bu_ftell (FILE *stream)
 

Detailed Description

Support routines for identifying properties of files and directories such as whether they exist or are the same as another given file.

Definition in file file.c.

Macro Definition Documentation

#define R_OK   4

Definition at line 46 of file file.c.

Referenced by bu_file_readable(), and file_access().

#define W_OK   2

Definition at line 49 of file file.c.

Referenced by bu_file_writable(), and file_access().

#define X_OK   1

Definition at line 52 of file file.c.

Referenced by bu_file_executable(), and file_access().

Function Documentation

HIDDEN int file_access ( const char *  path,
int  access_level 
)

common guts to the file access functions that returns truthfully if the current user has the ability permission-wise to access the specified file.

Definition at line 152 of file file.c.

References BU_STR_EQUAL, R_OK, UNLIKELY, W_OK, and X_OK.

Referenced by bu_file_executable(), bu_file_readable(), and bu_file_writable().