filenames are local (eg "saves/blah.sav") return: qtrue = OK
| 644 | // return: qtrue = OK |
| 645 | // |
| 646 | qboolean 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 | =========== |
no test coverage detected