Skip to content

Commit

Permalink
Give lua access to flushing a directory cache
Browse files Browse the repository at this point in the history
did not consider how this could go wrong but i needed this for one really specific time critical thing (the cache resets otherwise after 30 seconds)
  • Loading branch information
poco0317 committed Jul 5, 2021
1 parent d14f9d5 commit da41fbf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/RageUtil/File/RageFileManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1295,13 +1295,20 @@ class LunaRageFileManager : public Luna<RageFileManager>
LuaHelpers::CreateTableFromArray(vDirs, L);
return 1;
}
static int FlushDirCache(T* p, lua_State* L)
{
auto dir = SArg(1);
p->FlushDirCache(dir);
return 0;
}

LunaRageFileManager()
{
ADD_METHOD(DoesFileExist);
ADD_METHOD(GetFileSizeBytes);
ADD_METHOD(GetHashForFile);
ADD_METHOD(GetDirListing);
ADD_METHOD(FlushDirCache);
}
};

Expand Down

0 comments on commit da41fbf

Please sign in to comment.