Closed Rinkaa closed 3 years ago
I am still thinking about the logic on the whole... Is it still a good idea to keep FileSystem.IsDirectory(...)
like this?
function FileSystem.IsDirectory(Path)
return FileSystem.Exists(Path .. FileSystem.Separator())
end
What if there is a folder having same name as a file in the same directory? Some popular OS allow this after all...
Hi @Rinkaa what's the status on this? Can you confirm that this is fixed for Windows? I would test this PR if this dont break in Linux and then merge it if everything is ok
Hi @Rinkaa what's the status on this? Can you confirm that this is fixed for Windows? I would test this PR if this dont break in Linux and then merge it if everything is ok
Thank you for the ping! I totally forgot this PR ^_^;; sorry
the status
This PR is no longer effective now. It was meant for fixing #22 and nothing more actually. Should be closed back when #22 was closed by some other solution using FFI. Will close now.
Tested using
main.lua
on Windows 10 and Android.Files were regarded as folders to be expanded when OK button pressed, therefore could not be opened in "Open File" dialog on Windows. ( #22 )
Fixed by rewriting
FileSystem.Exists(...)
(e045c3b) , but there are some new issues coming up after this change:Result.Files
as an empty table, and accessingResult.Files[1]
would trigger an error:SlabTest.lua:1061: attempt to concatenate upvalue 'DrawDialog_FileDialog_Result' (a nil value)
. Fixed by hiding file entries in "Open Folder" dialog. (c7e3f99)ActiveInstance.Directory
withFileSystem.Seperator()
as the last char throughFileSystem.IsDirectory(...)
and thus would trigger an error. Fixed by preventing to add a seperator if there already exists, and letting folders returned byResult.Files
always end withFileSystem.Seperator()
. (26c448d)(Edited on Jun 10) All three types of dialogs should be working fine now. Summary of the changes:
FileSystem.Seperator()