|
UFO: Alien Invasion
|
Filesystem header file. More...


Go to the source code of this file.
Data Structures | |
| struct | qFILE |
| struct | filelink_t |
| Links one file onto another - like a symlink. More... | |
| struct | packfile_t |
| struct | pack_t |
| struct | searchpath_t |
| class | ScopedFile |
Macros | |
| #define | BASEDIRNAME "base" |
| #define | MAX_MAPS 400 |
| #define | MAX_QPATH 64 |
| #define | MAX_OSPATH 256 |
| #define | MAX_FILES 512 |
| #define | SFF_ARCH 0x01 |
| #define | SFF_HIDDEN 0x02 |
| #define | SFF_RDONLY 0x04 |
| #define | SFF_SUBDIR 0x08 |
| #define | SFF_SYSTEM 0x10 |
Enumerations | |
| enum | fsMode_t { FS_READ , FS_WRITE , FS_APPEND , FS_APPEND_SYNC } |
| enum | fsOrigin_t { FS_SEEK_CUR , FS_SEEK_END , FS_SEEK_SET } |
| enum | filemode_t { FILE_READ , FILE_WRITE , FILE_APPEND } |
Functions | |
| int | FS_FileLength (qFILE *f) |
| Returns the size of a given file or -1 if no file is opened. | |
| int | FS_Seek (qFILE *f, long offset, int origin) |
| Sets the file position of the given file. | |
| int | FS_WriteFile (const void *buffer, size_t len, const char *filename) |
| int | FS_Write (const void *buffer, int len, qFILE *f) |
| Properly handles partial writes. | |
| int | FS_Printf (qFILE *f, const char *msg,...) __attribute__((format(__printf__ |
| int void | FS_InitFilesystem (bool writeToHomeDir) |
| void | FS_AddGameDirectory (const char *dir, bool write) |
| Adds the directory to the head of the search path. | |
| void | FS_AddHomeAsGameDirectory (const char *dir, bool write) |
| void | FS_RestartFilesystem (const char *gamedir) |
| Restart the filesystem (reload all pk3 files). | |
| const char * | FS_Gamedir (void) |
| Called to find where to write a file (savegames, etc). | |
| void | FS_CreateOpenPipeFile (const char *filename, qFILE *f) |
| const char * | FS_NextPath (const char *prevpath) |
| Allows enumerating all of the directories in the search path. | |
| void | FS_ExecAutoexec (void) |
| int | FS_GetModList (struct linkedList_t **mods) |
| Searches and builds a list of mod directories. | |
| const char * | FS_GetCwd (void) |
| Return current working dir. | |
| void | FS_NormPath (char *path) |
| Convert operating systems path separators to ufo virtual filesystem separators (/). | |
| bool | FS_FileExists (const char *filename,...) __attribute__((format(__printf__ |
| bool void | FS_GetMaps (bool reset) |
| File the fs_maps array with valid maps. | |
| int | FS_OpenFile (const char *filename, qFILE *file, filemode_t mode) |
| Finds and opens the file in the search path. | |
| void | FS_CloseFile (qFILE *f) |
| Closes a file handle. | |
| bool | FS_RenameFile (const char *from, const char *to, bool relative) |
| Renames a file. | |
| void | FS_RemoveFile (const char *osPath) |
| void | FS_CopyFile (const char *fromOSPath, const char *toOSPath) |
| Copy a fully specified file from one place to another. | |
| int | FS_LoadFile (const char *path, byte **buffer) |
| Filenames are relative to the quake search path. | |
| int | FS_Read2 (void *buffer, int len, qFILE *f, bool failOnEmptyRead) |
| Read a file into a given buffer in memory. | |
| int | FS_Read (void *buffer, int len, qFILE *f) |
| void | FS_FreeFile (void *buffer) |
| int | FS_CheckFile (const char *fmt,...) __attribute__((format(__printf__ |
| int int | FS_BuildFileList (const char *files) |
| Build a filelist. | |
| const char * | FS_NextFileFromFileList (const char *files) |
| Returns the next file that is found in the virtual filesystem identified by the given file pattern. | |
| char * | FS_NextScriptHeader (const char *files, const char **name, const char **text) |
| void | FS_CreatePath (const char *path) |
| Creates any directories needed to store the given filename. | |
| char ** | FS_ListFiles (const char *findname, int *numfiles, unsigned musthave, unsigned canthave) |
| Builds a qsorted filelist. | |
| const char * | FS_GetFileData (const char *files) |
| Returns the buffer of a file. | |
| void | FS_Shutdown (void) |
| cleanup function | |
Variables | |
| char * | fs_maps [MAX_MAPS] |
| int | fs_numInstalledMaps |
Filesystem header file.
Definition in file filesys.h.
| #define BASEDIRNAME "base" |
Definition at line 34 of file filesys.h.
Referenced by CL_Init(), CL_LanguageTest(), CL_QueueHTTPDownload(), CL_StartHTTPDownload(), FS_GetModList(), and FS_InitFilesystem().
| #define MAX_FILES 512 |
Definition at line 47 of file filesys.h.
Referenced by FS_ListFiles().
| #define MAX_MAPS 400 |
Definition at line 37 of file filesys.h.
Referenced by FS_GetMaps().
| #define MAX_OSPATH 256 |
Definition at line 44 of file filesys.h.
Referenced by CIN_OpenCinematic(), CL_CheckAndQueueDownload(), CL_CheckOrDownloadFile(), CL_FinishHTTPDownload(), CL_Init(), CL_LanguageTest(), CL_QueueHTTPDownload(), CL_StartHTTPDownload(), Com_DefaultExtension(), Com_LoadLibrary(), CompareAttributes(), FixWorkingDirectory(), FS_AddGameDirectory(), FS_AddHomeAsGameDirectory(), FS_CreatePath(), FS_FileExists(), FS_GetCwd(), FS_GetMaps(), FS_GetModList(), FS_ListFiles(), FS_OpenFile(), FS_RenameFile(), GAME_GetTeamFileName(), GAME_LoadDefaultTeam(), GAME_LoadTeam_f(), GAME_SaveTeam_f(), GAME_TeamDelete_f(), GAME_TeamGetFreeFilename(), GAME_TeamSlotComments_f(), GenerateFootstepList(), GenerateMaterialFile(), main(), R_ScreenShot(), RT_WriteCSVFiles(), S_CompleteSounds(), SAV_GameDelete_f(), SAV_GameLoad(), SAV_GameLoad_f(), SAV_GameQuickLoadInit_f(), SAV_GameSave(), SAV_ListSaveGames_f(), SAV_LoadHeader(), SVCmd_WriteIP_f(), Sys_Access(), Sys_Cwd(), Sys_Fopen(), Sys_ListFilteredFiles(), Sys_Mkdir(), Sys_Remove(), Sys_Rename(), WEB_CGameDownloadFromUser(), WEB_ListCGameFilesCallback(), and WEB_UploadCGame_f().
| #define MAX_QPATH 64 |
Definition at line 40 of file filesys.h.
Referenced by ASE_KeyMAP_DIFFUSE(), CalcTextureReflectivity(), CheckBSPFile(), CIN_RunCinematic(), CL_CheckAndQueueDownload(), CL_DownloadUMPMap(), CL_Explode(), CL_PrecacheCharacterModels(), CL_SoundEvent(), CL_SoundEventTime(), CL_StartHTTPDownload(), CM_AddMapTile(), CM_LoadMap(), Cmd_GenericCompleteFunction(), Com_ConsoleCompleteCommand(), Com_WriteConfig_f(), ExportLightmap(), ExportLightmaps(), FixWorkingDirectory(), FS_BuildFileList(), FS_CheckFile(), FS_GetFileData(), FS_GetMaps(), FS_InitFilesystem(), FS_LoadPackFile(), FS_NextFileFromFileList(), FS_NextScriptHeader(), GetUMPName(), Key_WriteBindings_f(), M_Start(), ParseUMP(), PrecalcNormalsAndTangents(), R_AliasModelGetSkin(), R_FindImage(), R_FindModel(), R_ImageExists(), R_LoadAnimImages(), R_LoadImage(), R_LoadMaterials(), R_LoadModelAsync(), R_LoadObjSkin(), R_LoadShader(), R_ModBeginLoading(), R_ModLoadAliasMD2Model(), R_ModLoadLevelOfDetailData(), R_ModLoadMDX(), R_ModLoadTexinfo(), R_PreprocessShaderR(), readFile(), S_LoadSampleChunk(), S_LoadSampleIdx(), SV_CheckMap(), SV_LoadModelAABB(), SV_NextMapcycle(), SV_ParseUMP(), TEST_F(), UI_AutoGenerateSprite(), and UI_InitRadar().
| #define SFF_ARCH 0x01 |
Definition at line 123 of file filesys.h.
Referenced by CompareAttributes().
| #define SFF_HIDDEN 0x02 |
Definition at line 124 of file filesys.h.
Referenced by CompareAttributes(), FS_AddGameDirectory(), FS_BuildFileList(), FS_GetMaps(), and FS_GetModList().
| #define SFF_RDONLY 0x04 |
Definition at line 125 of file filesys.h.
Referenced by CompareAttributes().
| #define SFF_SUBDIR 0x08 |
Definition at line 126 of file filesys.h.
Referenced by CompareAttributes(), CompareAttributes(), FS_AddGameDirectory(), and FS_GetModList().
| #define SFF_SYSTEM 0x10 |
Definition at line 127 of file filesys.h.
Referenced by CompareAttributes(), FS_AddGameDirectory(), FS_BuildFileList(), FS_GetMaps(), and FS_GetModList().
| enum filemode_t |
| enum fsMode_t |
| enum fsOrigin_t |
| void FS_AddGameDirectory | ( | const char * | dir, |
| bool | write ) |
Adds the directory to the head of the search path.
| [in] | dir | The directory name relative to the game dir |
| [in] | write | Add this directory as writable (config files, save games) |
Definition at line 495 of file files.cpp.
References com_fileSysPool, Com_Printf(), Com_sprintf(), searchpath_t::filename, FS_ListFiles(), FS_LoadPackFile(), fs_searchpaths, i, MAX_OSPATH, MAX_PACKFILES, Mem_Free, Mem_PoolAllocType, searchpath_t::next, searchpath_t::pack, pakFileExt, Q_streq, Q_StringSort(), Q_strncpyz(), SFF_HIDDEN, SFF_SUBDIR, SFF_SYSTEM, and searchpath_t::write.
Referenced by FS_AddHomeAsGameDirectory(), FS_InitFilesystem(), FS_Printf(), main(), and TEST_Init().
| void FS_AddHomeAsGameDirectory | ( | const char * | dir, |
| bool | write ) |
| [in] | dir | The directory name relative to the game dir |
| [in] | write | Add this directory as writable (config files, save games) |
Definition at line 655 of file files.cpp.
References FS_AddGameDirectory(), FS_CreatePath(), FS_GetHomeDirectory(), MAX_OSPATH, Q_strcat(), and va().
Referenced by FS_InitFilesystem(), FS_Printf(), and TEST_Init().
Build a filelist.
| [in] | fileList | e.g. *.cfg to get all config files in the gamedir/ dir |
Definition at line 962 of file files.cpp.
References _AddToListBlock(), Com_FilePath(), com_fileSysPool, Com_sprintf(), listBlock_t::files, pack_t::files, findname, fs_blocklist, FS_ListFiles(), FS_NormPath(), fs_searchpaths, i, LIST_Count(), LIST_Delete(), LIST_Foreach, MAX_QPATH, Mem_Free, Mem_PoolAllocType, name, packfile_t::name, listBlock_t::next, pack_t::numfiles, listBlock_t::path, Q_streq, Q_strncpyz(), SFF_HIDDEN, SFF_SYSTEM, and Sys_ListFilteredFiles().
Referenced by CL_ParseMessageIDs(), Com_ParseScripts(), FS_CheckFile(), FS_GetFileData(), FS_NextFileFromFileList(), GAME_GetImportData(), GAME_GetTeamFileName(), GAME_TeamSlotComments_f(), cgame_import_t::int(), M_RandomTrack_f(), MD2Visitor(), PrecalcNormalsAndTangentsBatch(), TEST_F(), TEST_F(), TEST_ParseScript(), and UI_Restart_f().
| int FS_CheckFile | ( | const char * | fmt, |
| ... ) |
Closes a file handle.
Definition at line 43 of file cl_game_campaign.cpp.
References cgi, f, fs_openedFiles, and unzCloseCurrentFile().
Referenced by CIN_OGM_CloseCinematic(), CIN_ROQ_CloseCinematic(), CIN_ROQ_OpenCinematic(), Com_Error(), Com_Quit(), FS_FileExists(), GAME_GetImportData(), Key_WriteBindings(), cgame_import_t::void(), and ScopedFile::~ScopedFile().
| void FS_CopyFile | ( | const char * | fromOSPath, |
| const char * | toOSPath ) |
Copy a fully specified file from one place to another.
Definition at line 1654 of file files.cpp.
References com_fileSysPool, Com_Printf(), f, FILE, FS_CreatePath(), fs_searchpaths, len, Mem_Free, Mem_PoolAllocTypeN, SEEK_END, SEEK_SET, Sys_Error(), and Sys_Fopen().
Referenced by FS_FileExists().
Definition at line 47 of file files.cpp.
References Com_Printf(), f, FS_Gamedir(), fs_openedFiles, fs_searchpaths, OBJZERO, Q_strncpyz(), Sys_Error(), Sys_Mkfifo(), and va().
Referenced by FS_Printf(), and Qcommon_Init().
| void FS_CreatePath | ( | const char * | path | ) |
Creates any directories needed to store the given filename.
Definition at line 117 of file files.cpp.
References MAX_OSPATH, Q_strncpyz(), and Sys_Mkdir().
Referenced by CL_StartHTTPDownload(), FS_AddHomeAsGameDirectory(), FS_CheckFile(), FS_CopyFile(), and FS_OpenFile().
References FS_ExecAutoexec(), FS_GetCwd(), FS_GetModList(), and FS_NormPath().
Referenced by FS_ExecAutoexec(), Qcommon_Init(), and TEST_Init().
| bool FS_FileExists | ( | const char * | filename, |
| ... ) |
References __attribute__, f, format(), FS_CloseFile(), FS_CopyFile(), FS_FileExists(), FS_FreeFile(), FS_GetMaps(), FS_LoadFile(), FS_OpenFile(), FS_Read(), FS_Read2(), FS_RemoveFile(), FS_RenameFile(), and len.
Returns the size of a given file or -1 if no file is opened.
Definition at line 91 of file files.cpp.
References f, SEEK_END, SEEK_SET, Sys_Error(), unz_file_info::uncompressed_size, UNZ_OK, and unzGetCurrentFileInfo().
Referenced by ASE_Load(), FS_OpenFile(), FS_WriteFile(), and GAME_LoadTeam().
Definition at line 411 of file files.cpp.
References _Mem_Free().
Referenced by CM_AddMapTile(), Cmd_Exec_f(), FS_FileExists(), FS_GetFileData(), FS_NextScriptHeader(), GAME_GetImportData(), Img_LoadJPG(), Img_LoadPNG(), LoadBSPFile(), LoadModel(), M_Start(), M_Stop(), ModelWorker(), ParseUMP(), R_LoadMaterials(), R_LoadModelAsync(), R_LoadObjSkin(), R_LoadShader(), R_ModAddMapTile(), R_ModLoadAliasMD2Model(), R_ModLoadAnims(), R_ModLoadLevelOfDetailData(), R_ModLoadMDX(), R_PreprocessShaderR(), S_LoadSampleChunk(), SV_InitGameProgs(), SV_LoadModelAABB(), SV_ParseMapcycle(), SV_ParseUMP(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), cgame_import_t::void(), and game_import_t::void().
| const char * FS_Gamedir | ( | void | ) |
Called to find where to write a file (savegames, etc).
Definition at line 68 of file files.cpp.
References fs_searchpaths.
Referenced by CL_CheckAndQueueDownload(), CL_FinishHTTPDownload(), CL_StartHTTPDownload(), Com_Error(), Com_Quit(), FS_CreateOpenPipeFile(), FS_InitFilesystem(), FS_NextPath(), FS_OpenFile(), FS_Printf(), FS_RenameFile(), FS_WriteFile(), GAME_GetAbsoluteSavePath(), Key_WriteBindings(), R_ScreenShot(), SV_InitGameProgs(), TEST_F(), and WEB_CGameUpload().
| const char * FS_GetCwd | ( | void | ) |
Return current working dir.
Definition at line 1570 of file files.cpp.
References FS_NormPath(), MAX_OSPATH, Q_strncpyz(), and Sys_Cwd().
Referenced by CL_Init(), CL_LanguageTest(), and FS_ExecAutoexec().
| const char * FS_GetFileData | ( | const char * | files | ) |
Returns the buffer of a file.
| [in] | files | If nullptr, reset the filelist If not nullptr it may be something like *.cfg to get a list of all config files in base/. Calling FS_GetFileData("*.cfg"); until it returns nullptr is sufficient to get one buffer after another. |
Definition at line 1137 of file files.cpp.
References Com_Printf(), linkedList_t::data, listBlock_t::files, fs_blocklist, FS_BuildFileList(), FS_FreeFile(), FS_LoadFile(), MAX_QPATH, linkedList_t::next, listBlock_t::next, listBlock_t::path, Q_streq, and Q_strncpyz().
Referenced by Com_GetScriptChecksum(), and FS_CheckFile().
| bool void FS_GetMaps | ( | bool | reset | ) |
File the fs_maps array with valid maps.
| [in] | reset | If true the directory is scanned every time for new maps (useful for dedicated servers). If false we only use the maps array (for clients e.g.) |
Definition at line 1375 of file files.cpp.
References CheckBSPFile(), com_fileSysPool, Com_Printf(), Com_SkipPath(), Com_sprintf(), Com_StripExtension(), pack_t::files, findname, FS_ListFiles(), FS_MapDefSort(), fs_maps, fs_mapsInstalledInit, FS_NormPath(), fs_numInstalledMaps, fs_searchpaths, i, MAX_MAPS, MAX_OSPATH, MAX_QPATH, Mem_Free, Mem_PoolAllocTypeN, packfile_t::name, pack_t::numfiles, Q_strncpyz(), SFF_HIDDEN, and SFF_SYSTEM.
Referenced by FS_FileExists(), SV_CompleteMapCommand(), and SV_ListMaps_f().
| int FS_GetModList | ( | struct linkedList_t ** | mods | ) |
Searches and builds a list of mod directories.
Definition at line 669 of file files.cpp.
References BASEDIRNAME, FS_GetHomeDirectory(), FS_ListFiles(), i, LIST_AddString(), MAX_OSPATH, Mem_Free, MODS_DIR, PKGDATADIR, Q_strcat(), SFF_HIDDEN, SFF_SUBDIR, SFF_SYSTEM, and va().
Referenced by CLMN_Mods_f(), and FS_ExecAutoexec().
Definition at line 890 of file files.cpp.
References BASEDIRNAME, Cbuf_AddText(), Com_Printf(), Com_sprintf(), Cvar_GetString(), FS_AddGameDirectory(), FS_AddHomeAsGameDirectory(), FS_FileExists(), FS_Gamedir(), MAX_QPATH, MODS_DIR, PKGDATADIR, and Q_strvalid.
Referenced by FS_Printf(), main(), Qcommon_Init(), and TEST_Init().
| char ** FS_ListFiles | ( | const char * | findname, |
| int * | numfiles, | ||
| unsigned | musthave, | ||
| unsigned | canthave ) |
Builds a qsorted filelist.
Definition at line 562 of file files.cpp.
References com_fileSysPool, findname, i, MAX_FILES, MAX_OSPATH, Mem_PoolAllocTypeN, Mem_PoolStrDup, OBJZERO, Q_StringSort(), Q_strlwr(), Q_strncpyz(), Sys_FindClose(), Sys_FindFirst(), and Sys_FindNext().
Referenced by FS_AddGameDirectory(), FS_BuildFileList(), FS_CheckFile(), FS_GetMaps(), and FS_GetModList().
Filenames are relative to the quake search path.
| [in] | buffer | a null buffer will just return the file length without loading |
| [in] | path |
Definition at line 384 of file files.cpp.
References com_fileSysPool, FILE_READ, FS_OpenFile(), FS_Read(), len, and Mem_PoolAllocTypeN.
Referenced by Check_InitEntityDefs(), CL_CheckOrDownloadFile(), CL_ReVerifyHTTPQueue(), CL_UfoModuleLoader(), CM_AddMapTile(), Cmd_Exec_f(), FS_FileExists(), FS_GetFileData(), FS_NextScriptHeader(), GAME_GetImportData(), LoadBSPFile(), LoadModel(), LoadScriptFile(), M_Start(), ModelWorker(), ParseUMP(), R_FontAnalyze(), R_LoadMaterials(), R_LoadModel(), R_LoadObjSkin(), R_LoadShader(), R_ModAddMapTile(), R_ModLoadAliasMD2Model(), R_ModLoadAnims(), R_ModLoadLevelOfDetailData(), R_ModLoadMDX(), R_PreprocessShaderR(), readFile(), S_LoadSampleChunk(), SV_InitGameProgs(), SV_LoadModelAABB(), SV_ParseMapcycle(), SV_ParseUMP(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().
| const char * FS_NextFileFromFileList | ( | const char * | files | ) |
Returns the next file that is found in the virtual filesystem identified by the given file pattern.
| [in] | files | The file pattern to search for. This can e.g. be "*.ogg" or "**.ufo" to also include subdirectories. |
NULL if the end of the list was reached. NULL parameter for the pattern. FS_BuildFileList manually. Following calls will then use the new file list. Definition at line 1081 of file files.cpp.
References Com_Printf(), linkedList_t::data, listBlock_t::files, fs_blocklist, FS_BuildFileList(), MAX_QPATH, linkedList_t::next, listBlock_t::next, and listBlock_t::path.
Referenced by Cmd_CompleteExecCommand(), FS_CheckFile(), GAME_GetImportData(), GAME_GetTeamFileName(), GAME_TeamSlotComments_f(), M_CompleteMusic(), M_RandomTrack_f(), MD2Visitor(), PrecalcNormalsAndTangentsBatch(), S_CompleteSounds(), TEST_F(), TEST_F(), and TEST_F().
| const char * FS_NextPath | ( | const char * | prevpath | ) |
Allows enumerating all of the directories in the search path.
Definition at line 614 of file files.cpp.
References FS_Gamedir(), fs_searchpaths, and Q_streq.
Referenced by FS_Printf(), GAME_GetCGameAPI(), and SV_GetGameAPI().
| char * FS_NextScriptHeader | ( | const char * | files, |
| const char ** | name, | ||
| const char ** | text ) |
Definition at line 1196 of file files.cpp.
References Com_Parse(), Com_SkipBlock(), linkedList_t::data, listBlock_t::files, fs_blocklist, FS_FreeFile(), FS_LoadFile(), MAX_QPATH, MAX_VAR, name, linkedList_t::next, listBlock_t::next, listBlock_t::path, Q_streq, Q_strncpyz(), and Q_strneq.
Referenced by CL_ParseMessageIDs(), Com_ParseScripts(), FS_CheckFile(), GAME_GetImportData(), TEST_ParseScript(), and UI_Restart_f().
| void FS_NormPath | ( | char * | path | ) |
Convert operating systems path separators to ufo virtual filesystem separators (/).
Definition at line 83 of file files.cpp.
References Sys_NormPath().
Referenced by FS_BuildFileList(), FS_ExecAutoexec(), FS_GetCwd(), FS_GetMaps(), main(), and U2M_Parameter().
| int FS_OpenFile | ( | const char * | filename, |
| qFILE * | file, | ||
| filemode_t | mode ) |
Finds and opens the file in the search path.
Definition at line 162 of file files.cpp.
References Com_Printf(), Com_sprintf(), qFILE::f, FILE_APPEND, FILE_WRITE, packfile_t::filelen, pack_t::filename, qFILE::filepos, pack_t::files, FS_CreatePath(), FS_FileLength(), FS_Gamedir(), fs_links, fs_openedFiles, FS_OpenFile(), fs_searchpaths, pack_t::handle, i, length, MAX_OSPATH, packfile_t::name, qFILE::name, pack_t::numfiles, Q_strcasecmp, Q_strncpyz(), Sys_Error(), Sys_Fopen(), unz_file_info::uncompressed_size, UNZ_OK, unzGetCurrentFileInfo(), unzGetCurrentFileInfoPosition(), unzLocateFile(), unzOpenCurrentFile(), and qFILE::z.
Referenced by ASE_Load(), CheckBSPFile(), CIN_OGM_OpenCinematic(), CIN_ROQ_OpenCinematic(), CL_LogEvent(), Com_MD5File(), Com_SHA1File(), Com_SHA2File(), Com_vPrintf(), Com_WriteConfigToFile(), Con_LoadConsoleHistory(), Con_SaveConsoleHistory(), FS_CheckFile(), FS_FileExists(), FS_LoadFile(), FS_OpenFile(), FS_WriteFile(), GAME_GetImportData(), GAME_LoadTeam(), GAME_TeamSlotComments_f(), GenerateFootstepList(), GenerateMaterialFile(), Key_WriteBindings(), MD2SkinEdit(), MD2SkinNum(), R_ScreenShot(), RT_WriteCSVFiles(), UI_EditorNodeExtract_f(), WEB_CGameDownloadFromUser(), WriteBSPFile(), WriteMapFile(), WriteTGA24(), and WriteToFile().
Definition at line 371 of file files.cpp.
References f, FS_Read2(), and len.
Referenced by ASE_Load(), CheckBSPFile(), CIN_OGM_LoadBlockToSync(), CIN_ROQ_DecodeChunk(), CIN_ROQ_OpenCinematic(), Com_MD5File(), Com_SHA1File(), Com_SHA2File(), FS_FileExists(), FS_LoadFile(), FS_Seek(), GAME_GetImportData(), GAME_LoadTeam(), and GAME_TeamSlotComments_f().
Read a file into a given buffer in memory.
| [out] | buffer | Pointer to memory where file contents are written to. |
| [in] | len | The length of the supplied memory area. |
| [in] | f | The file which is to be read into the memory area. |
| [in] | failOnEmptyRead | idk Must have something to with certain readstates that can happen with removable media ? |
buffer is not null-terminated at the end of file reading len. Definition at line 327 of file files.cpp.
References f, len, MAX_READ, Sys_Error(), and unzReadCurrentFile().
Referenced by Com_ReadFromPipe(), FS_FileExists(), and FS_Read().
| void FS_RemoveFile | ( | const char * | osPath | ) |
Definition at line 1692 of file files.cpp.
References Com_Printf(), fs_searchpaths, Sys_Error(), and Sys_Remove().
Referenced by CL_FinishHTTPDownload(), Com_Error(), Com_Quit(), FS_FileExists(), GAME_GetImportData(), GAME_TeamDelete_f(), Key_WriteBindings(), Sys_Mkfifo(), and cgame_import_t::void().
| bool FS_RenameFile | ( | const char * | from, |
| const char * | to, | ||
| bool | relative ) |
Renames a file.
| [in] | from | The source filename |
| [in] | to | The filename we want after the rename |
| [in] | relative | If relative is true we have to add the FS_Gamedir path for writing |
Definition at line 1709 of file files.cpp.
References Com_sprintf(), FS_Gamedir(), fs_searchpaths, MAX_OSPATH, Sys_Error(), and Sys_Rename().
Referenced by CL_FinishHTTPDownload(), and FS_FileExists().
| void FS_RestartFilesystem | ( | const char * | gamedir | ) |
Restart the filesystem (reload all pk3 files).
Definition at line 1643 of file files.cpp.
References Com_Printf().
Referenced by CL_FinishHTTPDownload(), and FS_Printf().
Sets the file position of the given file.
| [in] | f | The opened file handle |
| [in] | origin | fsOrigin_t |
| [in] | offset | The offset you want to do the |
Definition at line 246 of file files.cpp.
References f, FS_Read(), FS_SEEK_CUR, FS_SEEK_END, FS_SEEK_SET, PK3_SEEK_BUFFER_SIZE, SEEK_CUR, SEEK_END, SEEK_SET, Sys_Error(), unzOpenCurrentFile(), and unzSetCurrentFileInfoPosition().
cleanup function
cleanup function
Definition at line 1604 of file files.cpp.
References com_fileSysPool, Com_Printf(), fs_blocklist, fs_links, fs_mapsInstalledInit, fs_numInstalledMaps, fs_openedFiles, fs_searchpaths, Mem_Free, Mem_FreePool, searchpath_t::next, and unzClose().
Referenced by FS_CheckFile(), Qcommon_Shutdown(), and TEST_Shutdown().
Properly handles partial writes.
Definition at line 1513 of file files.cpp.
References Com_Printf(), f, and len.
Referenced by AddLump(), Com_vPrintf(), Con_SaveConsoleHistory(), FS_WriteFile(), MD2SkinEdit(), MD2SkinNum(), R_WriteCompressedTGA(), WriteBSPFile(), WriteTGA24(), and WriteToFile().
Definition at line 1546 of file files.cpp.
References Com_Printf(), f, FILE_WRITE, FS_FileLength(), FS_Gamedir(), FS_OpenFile(), FS_Write(), len, Sys_Remove(), and va().
Referenced by GAME_GetImportData(), GAME_SaveTeam(), MD2GLCmdsRemove(), MD2SkinFix(), and TEST_F().
|
extern |
Definition at line 1313 of file files.cpp.
Referenced by FS_GetMaps(), SV_CompleteMapCommand(), and SV_ListMaps_f().
|
extern |
Definition at line 1314 of file files.cpp.
Referenced by FS_GetMaps(), FS_Shutdown(), SV_CompleteMapCommand(), and SV_ListMaps_f().