From: Perttu Ahola Date: Thu, 22 Mar 2012 22:05:32 +0000 (+0200) Subject: Fix filesys.cpp debug output to go into debug.txt X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=ede1674d6a93490795dbc2d1b79c20192b200ef5;p=zefram%2Fminetest%2Fminetest_engine.git Fix filesys.cpp debug output to go into debug.txt --- diff --git a/src/filesys.cpp b/src/filesys.cpp index 1070b31e..805aae6a 100644 --- a/src/filesys.cpp +++ b/src/filesys.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "strfnd.h" #include #include +#include "log.h" namespace fs { @@ -51,7 +52,7 @@ std::vector GetDirListing(std::string pathstring) if( DirSpec == NULL ) { - printf( "Insufficient memory available\n" ); + errorstream<<"GetDirListing: Insufficient memory available"< GetDirListing(std::string pathstring) // Check that the input is not larger than allowed. if (pathstring.size() > (BUFSIZE - 2)) { - _tprintf(TEXT("Input directory is too large.\n")); + errorstream<<"GetDirListing: Input directory is too large."< GetDirListing(std::string pathstring) if (hFind == INVALID_HANDLE_VALUE) { - _tprintf (TEXT("Invalid file handle. Error is %u.\n"), - GetLastError()); + errorstream<<"GetDirListing: Invalid file handle. Error is " + < GetDirListing(std::string pathstring) FindClose(hFind); if (dwError != ERROR_NO_MORE_FILES) { - _tprintf (TEXT("FindNextFile error. Error is %u.\n"), - dwError); - retval = (-1); - goto Cleanup; + errorstream<<"GetDirListing: FindNextFile error. Error is " + < GetDirListing(std::string pathstring) DIR *dp; struct dirent *dirp; if((dp = opendir(pathstring.c_str())) == NULL) { - //std::cout<<"Error("< list = GetDirListing(path); for(unsigned int i=0; i