VFS fun again

VFS fun again

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

VFS fun again

Post by gajop »

Code: Select all

-- all run in unsynced
local projectDir = "projects/Project-1"
Spring.CreateDir(projectDir) -- created in ~/.config/spring (on linux)
Spring.CreateDir(projectDir .. "/triggers") -- created in ~/.config/spring/projects/Project-1/triggers
Spring.Echo(VFS.FileExists(projectDir, VFS.RAW)) --result is false regardless if VFS.RAW is passed or not)
table.echo(VFS.SubDirs(""))  --table doesn't contain the "projects" dir
:evil:
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: VFS fun again

Post by Beherith »

And what is this?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: VFS fun again

Post by FLOZi »

Seen as it is gajop, most likely either ChiliLobby or ScenEd problems with VFS (again)
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: VFS fun again

Post by gajop »

Me going insane doing VFS stuff, but it turns out I was actually running this in synced, so it was mostly my error.
Will test thoroughly tomorrow.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: VFS fun again

Post by gajop »

Oh and another thing regarding VFS.FileExists, it seems to only work for files and not dirs?
LuaVFS.cpp -> FileHandler.cpp -> ... ->FileSystemAbstraction.cpp and what never gets invoked is DirExists.
Should we add a new VFS.DirExists or make the current .FileExists work for both files and dirs?
Post Reply

Return to “Lua Scripts”