I have an issue with mkdirs() on Mac OSX, it’s throwing exception like, “No such file or Directory” and it’s working fine in Windows. It seems, file permissions issue then I have assigned “Read & write” permissions for “everyone” then I can able to create folders from Servoy but I don’t want to provide “read & write” permission for everyone, which leads to security issues.
Is there any alternative for this ?, if so, please share to me.
Servoy Version : 7.4.2
Java : 7
Operating System : Mac
Thanks for the reply, The user who is running Servoy application is a Administrator and has permissions to “read & write”, though it’s throwing the exception “No such file or directory”. Do I need to create a new user for Servoy Application ?
I need to create a folder structure like, /A/B/C on Mac machine and I used below code for that
var fs = plugins.file.convertToJSFile("/A/B/C ");
fs.mkdirs()
but it throws an exception like, “No Such file or directory” (Exception happened in both Servoy developer and Smart client). I observed, there is a “Read only” permission for “everyone” user then I have modified the permission to “Read & Write” then I can able to create folder structure without any exception. Hope it is clear.
Why are you trying to write in a Mac-folder having read-only set for everyone in the first place?
Mac normally has a reason to have this set like this.
Can’t you use a parent folder on the Mac that has sufficient privileges, as you have on the Windows machine (where you obviously not care about security?!) ?
Maybe if you explain a little bit more about the reasons/goal of this, people can think of a solution for you.
Currently you’re asking for a solution to something that can’t be solved other than changing privileges, which you don’t like.
That makes it hard to help out…
Not sure how .convertToJSFile treats the path you give it.
In unix, a ‘/’ will take you to the root of the computer, where you certainly will not have access to write folders.
Could this be the reason it fails? (There is also a trailing space…)
Yes, I want to create a folders inside a root folder (“/”) on Mac OSX , for example, “/A/B/C” and I understand that it’s not possible. Thanks anyway for your help.
Not sure why you would want to create folders outside of the users home folder. They will not be accessible to the user.
The file plugin has a function get you the path of the users home folder. Here you can create folders - no problem. You may also be able to create folders inside the user called ‘Shared’.
You can also create folders for files shared by all our Servoy users inside the web root of the Servoy server. You can stream files to and from this location. A headless client running on the server can access this location directly.