nodester/nodester — Issue #313: EACCES, Permission denied when writing to subdirectories
Author: wachunga
Created: 2012-02-24 21:08:38+00:00
State: open

My app can't write to a subdirectory:

```
var file = path.normalize(__dirname + '/db/test.json');

fs.writeFile(file, JSON.stringify(stuff), function (err) {
if (err) {
console.log("Couldn't write file.");
throw err;
}
});

```

yields:

```
Error: EACCES, Permission denied '/app/db/test.json'
```

It looks like this may be by design, but I find it severely restrictive. I don't want to clutter the root of my app with created files.

If this is by design, is there any kind of workaround? My app allows people to create projects, and I'd like to write out a file for each into a subdirectory.