#include <windows.h>
#include <time.h>
#include "../file.h"
#include "../../string/wtstring.h"
#include "../../common/platform.h"
#include "../../common/common_utils.h"
#include "../../memory/memory.h"
Defines | |
#define | leap(y) (((y) % 4 == 0 && (y)% 100 != 0) || (y) % 400 == 0) |
#define | nleap(y) (((y) - 1969) / 4 - ((y) - 1901) / 100 + ((y) - 1601) / 400) |
Functions | |
PRIVATE W32 | FS_FileTimeToUnixTime (FILETIME *ft) |
Converts file time to UNIX time format. | |
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_CreateDirectory (const char *dirname) |
Creates a new directory. | |
PUBLIC wtBoolean | FS_RemoveDirectory (const char *pathname) |
Deletes an existing empty directory. | |
PUBLIC char * | FS_GetCurrentDirectory (void) |
Gets the current working directory. | |
PUBLIC wtBoolean | FS_ChangeCurrentDirectory (const char *path) |
Changes the current directory. | |
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. | |
PUBLIC wtBoolean | FS_CompareFileAttributes (const char *path, W32 musthave, W32 canthave) |
Compare directory and file attributes. | |
Variables | |
PRIVATE char | findFile [MAX_PATH] |
PRIVATE HANDLE | FindHandle |
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. |
PRIVATE W32 FS_FileTimeToUnixTime | ( | FILETIME * | ft | ) |
Converts file time to UNIX time format.
[in] | ft | Pointer to a FILETIME structure containing the file time to convert to UNIX date and time format. |
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. |