Go to the source code of this file.
Functions | |
char* | fname_split (const char *Fullname, char **Path, char **Name, char **Ext) |
fname_split(Fullname, Path, Name, Ext): splits the filename Fullname into Path, Name and Ext. More... | |
char* | change_ext (const char *Name, const char *Ext) |
change_ext(Name, Ext): changes the extension of the filename Name to Ext. More... | |
int | mkdir_p (const char *Path) |
mkdir_p(Path): creates the path Path with rwxrwxrwx permissions, spiced by the current umask of the process. More... |
Supports filename splitting, extension change and directory creation. Note that these routines are not portable to non-UNIX systems.
Definition in file dirfile.h.
|
fname_split(Fullname, Path, Name, Ext): splits the filename Fullname into Path, Name and Ext. Allocates and returns a string which is essentially Fullname but with appropriate \0-s inserted. So from Fullname --> "dir1/dir2/dir3/name.ext" you get "dir1/dir2/dir3/\0name\0.ext" ^ ^ ^ | | | *Path, *Name *Ext |
|
change_ext(Name, Ext): changes the extension of the filename Name to Ext. An extension is the part of the filename after the last dot ('.') after the last slash ('/') in it. Ext should begin with a dot. If Name has no extension, then Ext is simply appended to it. Return value: the modified Name (allocated within). |
|
mkdir_p(Path): creates the path Path with rwxrwxrwx permissions, spiced by the current umask of the process. Does the same job as the 'mkdir -p' UNIX command. Return value: 0 if OK, or the UNIX error number (errno) if something went wrong. |