lzwfs wip

This commit is contained in:
kepler155c@gmail.com
2019-11-05 12:14:01 -07:00
parent cecce156d7
commit 18441ffaef
3 changed files with 15 additions and 11 deletions

View File

@@ -157,9 +157,11 @@ local function split(str, pattern)
end
local function matchesFilter(fname)
for _, filter in pairs(filters) do
if fname:match(filter) then
return true
if not fname:find('lzwfs') then -- don't compress anything with lzwfs in name (sigh)
for _, filter in pairs(filters) do
if fname:match(filter) then
return true
end
end
end
end
@@ -193,7 +195,7 @@ function fs.open(fname, flags)
end,
}
elseif flags == 'w' or flags == 'a' then
if not matchesFilter(fs.combine(fname, '')) or true then
if not matchesFilter(fs.combine(fname, '')) then
return native.open(fname, flags)
end