DMCP interface  03.15_020
Other file functions

Filesystem functions. More...

Functions

int check_create_dir (const char *dir)
 Creates directory if doesn't exist. More...
 
int file_exists (const char *fn)
 Check whether file exists. More...
 
int file_size (const char *fn)
 Returns file size. More...
 
void make_date_filename (char *fn, const char *dir, const char *ext)
 Creates filename using current date/time. More...
 

Detailed Description

Filesystem functions.

Function Documentation

◆ check_create_dir()

int check_create_dir ( const char *  dir)

Creates directory if doesn't exist.

Parameters
dirDirectory pathname
Returns
Returns 0 on success

◆ file_exists()

int file_exists ( const char *  fn)

Check whether file exists.

Parameters
fnFile pathname
Returns
(0/1) 1 = File exists

◆ file_size()

int file_size ( const char *  fn)

Returns file size.

Parameters
fnFile pathname
Returns
File size or -1 if file doesn't exist

◆ make_date_filename()

void make_date_filename ( char *  fn,
const char *  dir,
const char *  ext 
)

Creates filename using current date/time.

Parameters
[out]fnString buffer for created filename
dirFile directory
extFile extension

Created string has following format:

/<dir>/YYYYMMDD-hhmmsscc<ext>

i.e. <ext> has to contain dot if required

Example usage

char fname[40];
make_date_filename(fname, PRINT_DIR, ".prn");