Basically, yes. But note that assets accessed via the Assets
API are read-only, but if you use the fs
commands, you can write to the files. However, bear in mind my comments about deployment. Deploying to many cloud services (including Galaxy and AWS EC2) provides a transient filesystem. While you can use EBS on EC2 to provide permanent disk storage, there is a further disadvantage of local storage: if you are running multiple instances, each has its own, independent local storage. Hence my suggestion to use S3.
I did test this myself to ensure nothing has changed, and I can create, write and read files and folders under private
. I used the async version:
fs.stat(directory, err => {
console.log(err);
fs.mkdir(directory, err => {
console.log(err);
});
});
which worked as expected. The “test and create” method is not recommended, because it offers no advantages over a simple fs.mkdir
or fs.mkdirSync
, which will always be atomic.
Note that the private
folder is not in your application root, but in the runtime root. In development, that’s D:\D drive\Ani\Learnings\Meteor\staticsite\.meteor\local\build\programs\private
as reported in your original post. When you deploy into production, your runtime root is whatever you want it to be.
Yes.
Yes - but note my comments about deployment and multiple instances.
Yes and no
Yes, if you create/update files in the private
folder in your app’s root in development*. No, if you do it in the private
folder in your runtime root. There is no file watching in a deployed, production app.
* Interestingly, I’ve just compared Windows with Linux and the Windows file watcher doesn’t pick up changes in the private
folder. I think that’s a bug.