MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / OpenExplicitFileRead

Method OpenExplicitFileRead

neo/framework/FileSystem.cpp:3252–3278  ·  view source on GitHub ↗

=========== idFileSystemLocal::OpenExplicitFileRead =========== */

Source from the content-addressed store, hash-verified

3250===========
3251*/
3252idFile *idFileSystemLocal::OpenExplicitFileRead( const char *OSPath ) {
3253 idFile_Permanent *f;
3254
3255 if ( !searchPaths ) {
3256 common->FatalError( "Filesystem call made without initialization\n" );
3257 }
3258
3259 if ( fs_debug.GetInteger() ) {
3260 common->Printf( "idFileSystem::OpenExplicitFileRead: %s\n", OSPath );
3261 }
3262
3263 common->DPrintf( "idFileSystem::OpenExplicitFileRead - reading from: %s\n", OSPath );
3264
3265 f = new idFile_Permanent();
3266 f->o = OpenOSFile( OSPath, "rb" );
3267 if ( !f->o ) {
3268 delete f;
3269 return NULL;
3270 }
3271 f->name = OSPath;
3272 f->fullPath = OSPath;
3273 f->mode = ( 1 << FS_READ );
3274 f->handleSync = false;
3275 f->fileSize = DirectFileLength( f->o );
3276
3277 return f;
3278}
3279
3280/*
3281===========

Callers 5

ReadCDKeyMethod · 0.80
HandleNoteCommandsMethod · 0.80
InitGameMethod · 0.80
OpenURLMethod · 0.80
LoadFileMethod · 0.80

Calls 4

GetIntegerMethod · 0.80
FatalErrorMethod · 0.45
PrintfMethod · 0.45
DPrintfMethod · 0.45

Tested by

no test coverage detected