Reputation: 1328
In Nodejs, when running
fs.readdirSync('/tmp');
I get result like:
['launchd-493.Je0U5v','npm-898-26dc6432']
Where is this /tmp folder? what does its path look like? (I'm using OSX)
The reason I'm asking this question is because I'm build a node app on a web host which has a read-only-files system in the node app folder, and I need to save some tmp files which is then uploaded to a backend like Parse.
Thanks!
Upvotes: 1
Views: 11462
Reputation: 72915
Most servers should use the system temp folder; /tmp
on OS X aliases to /private/tmp
, which has the default permissions: lrwxr-xr-x@ 1 root wheel
.
Unless your server is abnormally locked down, you should be able to use it.
You may want to consider something like tmp
as well which is tailored for temporary storage.
Upvotes: 6