Where should an app write files? FileWriter returns error
Our app should temporarily store files on disk and convert them. This works on our IP4xx but on one our IPVA installations it fails (even though the code is the same).
The app just writes a file to disk to convert, nothing special. But on the IPVA, the error is returned the filewriter does not have permissions.
12-23 11:13:01.161 FileTransferCache@xqting.com I> Got binary file of 154062 bytes
12-23 11:13:01.161 FileTransferCache@xqting.com FileSystem::OpenWriteFile fileName:test.mp3 append:0
12-23 11:13:01.161 FileTransferCache@xqting.com FileWrite(01032130)::FileWrite filenamePath:test.mp3 append:0 fopen() failed (13 : Permission denied)
12-23 11:13:01.161 FileTransferCache@xqting.com E> Failed to create an Innovaphone writer for file test.mp3
Questions:
- To which directory does one write if you just write a file with a filename without specifying any directory? (like in the above example)
- Is this always the same directory? Or is this dependent on environmental things, such as the current working directory that might change in the course of process execution, maybe caused by something else?
- Why do I get an error in this case, and not in other cases/installations?
- Is there a path where the app (instance) can write to so that it works guaranteed. As mentioned, these are only temporary files for conversion, so they are deleted as well at the end of the process. Is there something like a temp directory that we can use for this and that is accessible. This should be available without us having to change file/folder permissions on the OS.
Please advise
Wim