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

Method CreateOSPath

neo/framework/FileSystem.cpp:672–693  ·  view source on GitHub ↗

============ idFileSystemLocal::CreateOSPath Creates any directories needed to store the given filename ============ */

Source from the content-addressed store, hash-verified

670============
671*/
672void idFileSystemLocal::CreateOSPath( const char *OSPath ) {
673 char *ofs;
674
675 // make absolutely sure that it can't back up the path
676 // FIXME: what about c: ?
677 if ( strstr( OSPath, ".." ) || strstr( OSPath, "::" ) ) {
678#ifdef _DEBUG
679 common->DPrintf( "refusing to create relative path \"%s\"\n", OSPath );
680#endif
681 return;
682 }
683
684 idStr path( OSPath );
685 for( ofs = &path[ 1 ]; *ofs ; ofs++ ) {
686 if ( *ofs == PATHSEPERATOR_CHAR ) {
687 // create the directory
688 *ofs = 0;
689 Sys_Mkdir( path );
690 *ofs = PATHSEPERATOR_CHAR;
691 }
692 }
693}
694
695/*
696=================

Callers 4

ConvertMayaToMD5Method · 0.80
WriteCDKeyMethod · 0.80
HandleDownloadsMethod · 0.80
ConvertMayaToMD5Method · 0.80

Calls 2

Sys_MkdirFunction · 0.50
DPrintfMethod · 0.45

Tested by

no test coverage detected