============ idFileSystemLocal::TouchFileList_f Takes a text file and touches every file in it, use one file per line. ============ */
| 2053 | ============ |
| 2054 | */ |
| 2055 | void idFileSystemLocal::TouchFileList_f( const idCmdArgs &args ) { |
| 2056 | |
| 2057 | if ( args.Argc() != 2 ) { |
| 2058 | common->Printf( "Usage: touchFileList <filename>\n" ); |
| 2059 | return; |
| 2060 | } |
| 2061 | |
| 2062 | const char *buffer = NULL; |
| 2063 | idParser src( LEXFL_NOFATALERRORS | LEXFL_NOSTRINGCONCAT | LEXFL_ALLOWMULTICHARLITERALS | LEXFL_ALLOWBACKSLASHSTRINGCONCAT ); |
| 2064 | if ( fileSystem->ReadFile( args.Argv( 1 ), ( void** )&buffer, NULL ) && buffer ) { |
| 2065 | src.LoadMemory( buffer, strlen( buffer ), args.Argv( 1 ) ); |
| 2066 | if ( src.IsLoaded() ) { |
| 2067 | idToken token; |
| 2068 | while( src.ReadToken( &token ) ) { |
| 2069 | common->Printf( "%s\n", token.c_str() ); |
| 2070 | session->UpdateScreen(); |
| 2071 | idFile *f = fileSystemLocal.OpenFileRead( token ); |
| 2072 | if ( f ) { |
| 2073 | fileSystemLocal.CloseFile( f ); |
| 2074 | } |
| 2075 | } |
| 2076 | } |
| 2077 | } |
| 2078 | |
| 2079 | } |
| 2080 | |
| 2081 | |
| 2082 | /* |
nothing calls this directly
no test coverage detected