#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <errno.h>
#include <stdio.h>
#include <dirent.h>
#include <unistd.h>
#include <string.h>
#include <glob.h>
#include "../../memory/memory.h"
#include "../../common/platform.h"
#include "../../common/common_utils.h"
#include "../../string/wtstring.h"
#include "../file.h"
Functions | |
PUBLIC wtBoolean | FS_CreateDirectory (const char *dirname) |
Creates a new directory. | |
PUBLIC wtBoolean | FS_ChangeCurrentDirectory (const char *path) |
Changes the current directory. | |
PUBLIC char * | FS_GetCurrentDirectory (void) |
Gets the current working directory. | |
PUBLIC wtBoolean | FS_RemoveDirectory (const char *pathname) |
Deletes an existing empty directory. | |
PUBLIC wtBoolean | FS_DeleteFile (const char *filename) |
Deletes an existing file. | |
PUBLIC wtBoolean | FS_GetFileAttributes (const char *filename, struct filestats *fs) |
Retrieves attributes for a specified file or directory. | |
PUBLIC wtBoolean | FS_CompareFileAttributes (const char *path, W32 musthave, W32 canthave) |
Compare directory and file attributes. | |
PUBLIC char * | FS_FindFirst (const char *path) |
Searches a directory for a file or subdirectory with a name that matches a specific name. | |
PUBLIC char * | FS_FindNext (void) |
Continues a file search from a previous call to the FS_FindFirst function. | |
PUBLIC void | FS_FindClose (void) |
Closes the search handle. | |
Variables | |
PRIVATE wtBoolean | bFindOn = false |
PRIVATE glob_t | glob_results |
PRIVATE W32 | findCount = 0 |
PUBLIC wtBoolean FS_ChangeCurrentDirectory | ( | const char * | path | ) |
Changes the current directory.
[in] | path | Pointer to a NUL-terminated string that specifies the path to the new directory. |
PUBLIC wtBoolean FS_CompareFileAttributes | ( | const char * | path, | |
W32 | musthave, | |||
W32 | canthave | |||
) |
Compare directory and file attributes.
[in] | path | Specifies the path to compare file attributes. |
[in] | musthave | File or directory must have these attributes. |
[in] | canthave | File or directory can not have these attributes. |
PUBLIC wtBoolean FS_CreateDirectory | ( | const char * | dirname | ) |
Creates a new directory.
[in] | dirname | Pointer to a NUL-terminated string that specifies the path of the directory to be created. |
PUBLIC wtBoolean FS_DeleteFile | ( | const char * | filename | ) |
Deletes an existing file.
[in] | filename | Pointer to a NUL-terminated string that specifies the file to be deleted. |
PUBLIC char* FS_FindFirst | ( | const char * | path | ) |
Searches a directory for a file or subdirectory with a name that matches a specific name.
[in] | path | Pointer to a NUL-terminated string that specifies a valid directory or path and file name that can contain wildcard characters. |
PUBLIC char* FS_FindNext | ( | void | ) |
Continues a file search from a previous call to the FS_FindFirst function.
PUBLIC char* FS_GetCurrentDirectory | ( | void | ) |
Gets the current working directory.
PUBLIC wtBoolean FS_GetFileAttributes | ( | const char * | filename, | |
struct filestats * | fs | |||
) |
Retrieves attributes for a specified file or directory.
[in] | filename | Pointer to a NUL-terminated string that specifies a file or directory. |
[in] | fs | Pointer to a filestats structure that receives the attribute information. |
PUBLIC wtBoolean FS_RemoveDirectory | ( | const char * | pathname | ) |
Deletes an existing empty directory.
[in] | dirname | Pointer to a NUL-terminated string that specifies the directory to be deleted. |