inc/file.h File Reference

Header - File operations. More...

#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

off_t file_filesize (const char *filename)
 get size of a file
off_t file_filesize_f (FILE *f)
 get size of an opened file
void file_path_explode (char *path, char **dir, char **file, char **ext)
 modify path to directory, file and extension string - path is destroyed
bool file_set_context (const char *device)
 set the working directory (the device where a db5 database is)
bool file_exists (const char *path)
 test if the file exists
const char * file_remove_headslash (const char *path)
 test if the file exists
const char * file_get_extension (const char *path)
 return extension of a file (incluing dot)
void file_windows_slashes (char *path)
 alter a path string to turn slashes to counterslashes
FILE * file_fcaseopen (const char *directory, const char *filename, const char *mode)
 open the first file that match to specified filename without case sensitivity
bool file_truncate (FILE *f, const off_t len)
 truncate a file

Variables

char file_common_buffer [10240]
 shared buffer for file operation

Detailed Description

Header - File operations.

Author:
Julien Blitte
Version:
0.1

Definition in file file.h.


Function Documentation

bool file_exists ( const char *  path  ) 

test if the file exists

Parameters:
path to filename - utf8
Returns:
true is filename exists

Definition at line 97 of file file.c.

References check.

Referenced by db5_generate_row().

FILE* file_fcaseopen ( const char *  directory,
const char *  filename,
const char *  mode 
)

open the first file that match to specified filename without case sensitivity

Parameters:
directory the directory where file must be found - utf8
filename the filename to try to find - utf8
mode file mode
Returns:
file handle or NULL if not found and file cannot be created

Definition at line 147 of file file.c.

References add_log(), ADDLOG_DUMP, ADDLOG_FAIL, ADDLOG_RECOVER, check, and log_dump().

Referenced by db5_dat_init(), db5_hdr_init(), db5_index_index_column(), names_init(), and names_save().

off_t file_filesize ( const char *  filename  ) 

get size of a file

Parameters:
filename the path to file - utf8
Returns:
size of file

Definition at line 24 of file file.c.

References add_log(), ADDLOG_FAIL, check, and log_dump().

Referenced by asf_generate_row().

off_t file_filesize_f ( FILE *  f  ) 

get size of an opened file

Parameters:
f an opened file
Returns:
size of file

Definition at line 40 of file file.c.

References add_log(), ADDLOG_FAIL, and check.

const char* file_get_extension ( const char *  path  ) 

return extension of a file (incluing dot)

Parameters:
path filename/path to get extension - utf8 or latin1
Returns:
pointer to extension in the filename

Definition at line 116 of file file.c.

References check.

Referenced by names_generate_shortname(), and names_select_shortname().

void file_path_explode ( char *  path,
char **  dir,
char **  file,
char **  ext 
)

modify path to directory, file and extension string - path is destroyed

Parameters:
path the path to explode in directory, file and extension - destroyed - utf8 or latin1
dir directory pointer address - path's charset
file file pointer address - path's charset
ext extension pointer address - path's charset

Definition at line 55 of file file.c.

References check.

Referenced by db5_generate_row().

const char* file_remove_headslash ( const char *  path  ) 

test if the file exists

Parameters:
path to filename - utf8 or latin1
Returns:
true is filename exists

Definition at line 104 of file file.c.

References check.

Referenced by fuse_impl_create(), fuse_impl_flush(), fuse_impl_getattr(), fuse_impl_open(), fuse_impl_rename(), fuse_impl_truncate(), fuse_impl_unlink(), and fuse_impl_utimens().

bool file_set_context ( const char *  device  ) 

set the working directory (the device where a db5 database is)

Parameters:
device the device where we want to fix working directory - utf8
Returns:
true is successfull

Definition at line 83 of file file.c.

References add_log(), ADDLOG_FAIL, check, and log_dump().

Referenced by fuse_impl_init().

bool file_truncate ( FILE *  f,
const off_t  len 
)

truncate a file

Parameters:
f file to truncate
len new size of file
Returns:
true if successfull

Definition at line 190 of file file.c.

References add_log(), ADDLOG_FAIL, and check.

Referenced by db5_dat_delete_row().

void file_windows_slashes ( char *  path  ) 

alter a path string to turn slashes to counterslashes

Parameters:
path filename/path to turn slashes - utf8 or latin1

Definition at line 133 of file file.c.

References check.

Referenced by db5_generate_row().

 All Classes Files Functions Variables Typedefs Defines

Generated on Mon Jan 11 00:15:07 2010 for db5fuse by  doxygen 1.6.1