This commit is contained in:
Grump
2020-05-11 09:57:16 +02:00
parent fc5152860e
commit db63f71fe9
2 changed files with 3 additions and 4 deletions

View File

@@ -56,7 +56,7 @@ Function names in this list are links to their LÖVE `File` counterparts. `File`
## Example ## Example
``` ```lua
local nativefs = require("nativefs") local nativefs = require("nativefs")
-- deletes all files in C:\Windows -- deletes all files in C:\Windows

View File

@@ -301,10 +301,9 @@ function nativefs.newFileData(filepath)
local ok, err = f:open('r') local ok, err = f:open('r')
if not ok then return nil, err end if not ok then return nil, err end
local data, err = f:read() local data, err = f:read('data', 'all')
f:close() f:close()
if not data then return nil, err end return data, err
return love.filesystem.newFileData(data, filepath)
end end
function nativefs.mount(archive, mountPoint, appendToPath) function nativefs.mount(archive, mountPoint, appendToPath)