Open parth-io opened 2 years ago
Possibly related to this?
Thanks for pointing this out, it does sound like a tricky problem.
As far as I can tell, the forward slash is a reserved character in Unix systems, so it looks forbidden to have a directory called 'Tutorial 1-Admin affairs/grouping/case discussion'.
The issue you mentioned in line 68 can be fixed (we can actually change folder_name
to any random name and it'll work normally, the exact name is not important). But what's more tricky is that the contents of the original downloaded zip file will likely still have '/'s in them, and it'll be hard to disambiguate between legitimate forward slashes and 'fake' ones. Because of that, I have a suspicion that this problem can't be fixed on our end alone and might require some help on LumiNUS's end as well (like #2).
Could I trouble your friend to download the folder as a zip file directly from LumiNUS, extract it locally on their OS (Mac/Linux), and see what happens as a result? I'm guessing it'll produce the additional nested folders, but would like to make sure. Thanks!
My friend came across this rare problem where if the folder name contains forward slashes, the code breaks (on MacOS and Linux, not sure for Windows).
For example, a path on Luminus can look like this:
My Modules > PS2240 > Files > Tutorial Readings > Tutorial 1-Admin affairs/grouping/case discussion > Tutorial.pdf
'Tutorial 1-Admin affairs/grouping/case discussion' is a permissible folder name on Luminus.However, when
fs
parses the path, the path looks like this: 'PS2240/Tutorial Readings/Tutorial 1-Admin affairs/grouping/case discussion', so the program thinks that 'grouping' and 'case discussion' are additional folders to be created.More specifically, the code stops working at line 68 in downloader.js, when
writeFile()
call is made indownloadFolder()
.Possible solutions:
Any ideas on how to resolve this?