I have read reference of LuaFileSystem
, but it seems have no function to get a file's parent folder. And I also search "file" or "dir" in Lua 5.1 Reference Manual, there are just io operations. How should I do?
The ugly method I have thought is cut strings after the last '/' or '\'. Just like C:\\data\\file.text
to C:\\data
. But I think there should be a better way to do this.