| 683 | |
| 684 | |
| 685 | bool Path_WriteStringToTextFile( const std::string &strFilename, const char *pchData ) |
| 686 | { |
| 687 | FILE *f; |
| 688 | #if defined( POSIX ) |
| 689 | f = fopen( strFilename.c_str(), "w" ); |
| 690 | #else |
| 691 | std::wstring wstrFilename = UTF8to16( strFilename.c_str() ); |
| 692 | errno_t err = _wfopen_s( &f, wstrFilename.c_str(), L"w" ); |
| 693 | if ( err != 0 ) |
| 694 | { |
| 695 | f = NULL; |
| 696 | } |
| 697 | #endif |
| 698 | |
| 699 | bool ok = false; |
| 700 | |
| 701 | if ( f != NULL ) |
| 702 | { |
| 703 | ok = fputs( pchData, f) >= 0; |
| 704 | fclose(f); |
| 705 | } |
| 706 | |
| 707 | return ok; |
| 708 | } |
| 709 | |
| 710 | bool Path_WriteStringToTextFileAtomic( const std::string &strFilename, const char *pchData ) |
| 711 | { |
no test coverage detected