libRASCH: ra_file.c File Reference
ra_file.c File Reference
Include dependency graph for ra_file.c:
Go to the source code of this file.
Defines
#define _LIBRASCH_BUILD
Functions
int find_files_win32 (const char *dir, const char *mask, char ***f, int *num, long *size)
int find_files_linux (const char *dir, const char *mask, char ***f, int *num, long *size)
FILE * _ra_fopen (const char *fn, const char *mode, int dir_based, char *fn_ok, int buf_len)
implementation for Linux version of ra_fopen()
int ra_get_filename (const char *fn, int dir_based, char *buf, int buf_len)
return "case-corrected" filename
FILE * ra_fopen (const char *fn, const char *mode, int dir_based)
opens a file
int find_meas (const char *dir, const char *mask, struct find_meas *f, int(*check_meas)(const char *))
search in a directory for specific file format
int find_files (const char *dir, const char *mask, char ***f, int *num, long *size)
file-search function for libRASCH plugins (OS independent)
int make_dir (const char *dir)
Win32 implementation for find_meas() Linux implementation for find_meas() create a directory (OS independent).
int copy_move_file (const char *file, const char *dest_dir, int copy)
copy or move a file (OS independent)
int delete_file (const char *file)
delete a file (OS independent)
Detailed Description
This file provides support for handling files in libRASCH.
Author: Raphael Schneider (rasch@med1.med.tum.de )
Definition in file ra_file.c .
Define Documentation
Function Documentation
FILE * _ra_fopen
(
const char *
fn ,
const char *
mode ,
int
dir_based ,
char *
fn_ok ,
int
buf_len
)
int copy_move_file
(
const char *
file ,
const char *
dest_dir ,
int
copy
)
Parameters:
<file> source file
<dest_dir> destination directory
<copy> flag if file should be copied (=1) or moved (=0)
Function copy or move a file in the destination directory.
Definition at line 504 of file ra_file.c .
References MAX_PATH_RA , and utf8_to_local() .
Referenced by copy_move_meas() .
int delete_file
(
const char *
file
)
int find_files
(
const char *
dir ,
const char *
mask ,
char ***
f ,
int *
num ,
long *
size
)
Parameters:
<dir> directory in which files are searched for
<mask> file-mask
<f> pointer to the buffer receiving the found file-names
<num> pointer to the buffer-size
<size> receive the sum of the size for the found files
The function search in a directory for files using the given file-mask. The function provides a OS independent file-search.
Definition at line 292 of file ra_file.c .
References find_files_linux() , and find_files_win32() .
Referenced by find_meas() .
int find_files_linux
(
const char *
dir ,
const char *
mask ,
char ***
f ,
int *
num ,
long *
size
)
int find_files_win32
(
const char *
dir ,
const char *
mask ,
char ***
f ,
int *
num ,
long *
size
)
int find_meas
(
const char *
dir ,
const char *
mask ,
struct find_meas *
f ,
int(*)(const char *)
check_meas
)
Parameters:
<dir> directory to look in
<mask> file-mask used to select specific files
<f> pointer to a find-meas struct receiving the found measurements
<check_meas> pointer to the function checking if the found file's are supported measurements
The function search in a directory for measurements which are handled by the calling plugin. The function calls 'check_meas' (provided by the plugin) to check if the found file's are supported measurements.
Definition at line 239 of file ra_file.c .
References find_files() , find_meas::names , find_meas::num , and ra_alloc_mem .
int make_dir
(
const char *
dir
)
FILE* ra_fopen
(
const char *
fn ,
const char *
mode ,
int
dir_based
)
Parameters:
<fn> filename
<mode> the fopen file-open mode characters
<dir_based> flag if measurement-files are stored in a directory (=1) or not (!=1)
The function tries different case combinations to open the file if the given filename can not be found.
Definition at line 88 of file ra_file.c .
References _ra_fopen() .
int ra_get_filename
(
const char *
fn ,
int
dir_based ,
char *
buf ,
int
buf_len
)
Parameters:
<fn> input filename
<buf> buffer for "case-corrected" filename
<buf_len> length of buffer 'buf'
The function tries to find how the given filename is used on the current system (case wise) and returns the filename case corrected.
Definition at line 56 of file ra_file.c .
References _ra_fopen() , and MAX_PATH_RA .
Generated on Fri May 27 11:33:30 2005 for libRASCH by
1.4.2