Dec 31, 2014 at 3:01 AM
Edited Dec 31, 2014 at 6:49 AM
I'm facing problem on Mac when try to get file from server and save to the specific path:
on Mac: std::string filePath ="Macintosh:Users:<username>:folder1:folder2:fileName.jpg";
on Win: std::string filePath ="C:\Users\<username>\folder1\folder2\fileName.jpg";
file_buffer<uint8_t>::open(filePath , std::ios::out).then([=](streambuf<uint8_t> outFile) -> pplx::task<http_response>
*fileBuffer = outFile;
// Create an HTTP request.
// Encode the URI query since it could contain special characters like spaces.
on Window it works fine.
but on Mac the fileName is auto changed to "Macintosh/Users/<username>/folder1/folder2/fileName.jpg" and saved to the path of running program. not save to the path "Macintosh:Users:<username>:folder1:folder2:"
I had a look at template of ::Open(...), and found that the filePath is understood fileName by Mac.
so how to save the file "fileName.jpg" to the specific path "Macintosh:Users:<username>:folder1:folder2:" directly on Mac?
currently I'm using moveFile function to do this.