| 816 | } |
| 817 | |
| 818 | bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData ) |
| 819 | { |
| 820 | FILE *f; |
| 821 | #if defined( POSIX ) |
| 822 | f = fopen( strFilename.c_str(), "w" ); |
| 823 | #else |
| 824 | std::wstring wstrFilename = UTF8to16( strFilename.c_str() ); |
| 825 | errno_t err = _wfopen_s( &f, wstrFilename.c_str(), L"w" ); |
| 826 | if ( err != 0 ) |
| 827 | { |
| 828 | f = NULL; |
| 829 | } |
| 830 | #endif |
| 831 | |
| 832 | bool ok = false; |
| 833 | |
| 834 | if ( f != NULL ) |
| 835 | { |
| 836 | ok = fputs( pchData, f) >= 0; |
| 837 | fclose(f); |
| 838 | } |
| 839 | |
| 840 | return ok; |
| 841 | } |
| 842 | |
| 843 | bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData ) |
| 844 | { |
no test coverage detected