From db63f71fe90e4e3459d29f3021957cb16aea467e Mon Sep 17 00:00:00 2001 From: Grump Date: Mon, 11 May 2020 09:57:16 +0200 Subject: [PATCH] cleanup --- README.md | 2 +- nativefs.lua | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 980e819..b71ebdb 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ Function names in this list are links to their LÖVE `File` counterparts. `File` ## Example -``` +```lua local nativefs = require("nativefs") -- deletes all files in C:\Windows diff --git a/nativefs.lua b/nativefs.lua index 67d086f..2118c7f 100644 --- a/nativefs.lua +++ b/nativefs.lua @@ -301,10 +301,9 @@ function nativefs.newFileData(filepath) local ok, err = f:open('r') if not ok then return nil, err end - local data, err = f:read() + local data, err = f:read('data', 'all') f:close() - if not data then return nil, err end - return love.filesystem.newFileData(data, filepath) + return data, err end function nativefs.mount(archive, mountPoint, appendToPath)