mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 18:45:17 -04:00
Fixed problem with utf characters in the %APPDATA% path on Windows.
Added function for opening files on Windows and Linux - RsDirUtil::rs_fopen. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4124 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
bc78397a64
commit
bc113326e4
17 changed files with 109 additions and 119 deletions
|
@ -251,13 +251,7 @@ int ftFileCreator::locked_initializeFileAttrs()
|
|||
* attempt to open file
|
||||
*/
|
||||
|
||||
#ifdef WINDOWS_SYS
|
||||
std::wstring wfile_name;
|
||||
librs::util::ConvertUtf8ToUtf16(file_name, wfile_name);
|
||||
fd = _wfopen(wfile_name.c_str(), L"r+b");
|
||||
#else
|
||||
fd = fopen64(file_name.c_str(), "r+b");
|
||||
#endif
|
||||
fd = RsDirUtil::rs_fopen(file_name.c_str(), "r+b");
|
||||
|
||||
if (!fd)
|
||||
{
|
||||
|
@ -268,11 +262,7 @@ int ftFileCreator::locked_initializeFileAttrs()
|
|||
std::cerr << std::endl;
|
||||
|
||||
/* try opening for write */
|
||||
#ifdef WINDOWS_SYS
|
||||
fd = _wfopen(wfile_name.c_str(), L"w+b");
|
||||
#else
|
||||
fd = fopen64(file_name.c_str(), "w+b");
|
||||
#endif
|
||||
fd = RsDirUtil::rs_fopen(file_name.c_str(), "w+b");
|
||||
if (!fd)
|
||||
{
|
||||
std::cerr << "ftFileCreator::initializeFileAttrs()";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue