Closed aliciatang07 closed 6 years ago
I am merging this issue with the previous one which was open.
Currently you cannot use unix-style relative paths because what the cwd (current working directory) is for a ThingsJS worker is unclear. Once we establish what the cwd would be, we can start supporting relative paths. For now, let's just stick to absolute paths.
It is able to read from the folders. We tested. The problem currently is it can only write to nested folders if there already exists a file. If the file does not exist, it is unable to create the file in the nested folder. So a separate create function should do the task?
Also second thing is will the users be running the benchmarks? The reason I ask is for testing and running the benchmarks right now we have a small hack that works but it might not work for the users.
On Mon, 8 Oct, 2018, 11:10 AM Xuejie(Alicia) Tang, notifications@github.com wrote:
The writefile and readfile function only support for the operation in the root folder, once I want to specify a subdirectory like apps, it feels to navigate inside to do the read or write operation. For example GFS.readFile('./code/test.json', function(err,data){ console.log(data); }) should read te file inside the code folder, but it throw me an error as not found. for write GFS.writeFile('./code/test.json', testdata,function(err,data){ console.log(data); }), it failed to write data inside code folder and only write it to root folder.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DependableSystemsLab/ThingsJS/issues/40, or mute the thread https://github.com/notifications/unsubscribe-auth/AJtt-GpCJ9Wmy8d-tXkKIg89FeogBAZGks5ui5T1gaJpZM4XNbK_ .
The writefile and readfile function only support for the operation in the root folder, once I want to specify a subdirectory like apps, it feels to navigate inside to do the read or write operation. For example GFS.readFile('./code/test.json', function(err,data){ console.log(data); }) should read te file inside the code folder, but it throw me an error as not found. for write GFS.writeFile('./code/test.json', testdata,function(err,data){ console.log(data); }), it failed to write data inside code folder and only write it to root folder.