MCPcopy Create free account
hub / github.com/JACoders/OpenJK / FS_MoveUserGenFile

Function FS_MoveUserGenFile

code/qcommon/files.cpp:646–665  ·  view source on GitHub ↗

filenames are local (eg "saves/blah.sav") return: qtrue = OK

Source from the content-addressed store, hash-verified

644// return: qtrue = OK
645//
646qboolean FS_MoveUserGenFile( const char *filename_src, const char *filename_dst ) {
647 char *from_ospath, *to_ospath;
648
649 FS_AssertInitialised();
650
651 // don't let sound stutter
652 S_ClearSoundBuffer();
653
654 from_ospath = FS_BuildOSPath( fs_homepath->string, fs_gamedir, filename_src );
655 to_ospath = FS_BuildOSPath( fs_homepath->string, fs_gamedir, filename_dst );
656
657 if ( fs_debug->integer ) {
658 Com_Printf( "FS_MoveUserGenFile: %s --> %s\n", from_ospath, to_ospath );
659 }
660
661 FS_CheckFilenameIsMutable( to_ospath, __func__ );
662
663 remove( to_ospath );
664 return (qboolean)!rename( from_ospath, to_ospath );
665}
666
667/*
668===========

Callers 1

renameMethod · 0.85

Calls 5

FS_AssertInitialisedFunction · 0.70
FS_BuildOSPathFunction · 0.70
Com_PrintfFunction · 0.70
S_ClearSoundBufferFunction · 0.50

Tested by

no test coverage detected