From 02a7b3005bdd7a6c0e4b8911c6d4e9ffa09a7e2f Mon Sep 17 00:00:00 2001 From: EngineerSmith <56016593+EngineerSmith@users.noreply.github.com> Date: Tue, 14 Nov 2023 19:47:48 +0000 Subject: [PATCH] Fixed bad example which deleted all files in c:\windows --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1a40b62..bd239ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +This is a re-host as previously it was taken down by the original developer. Pull requests for fixes are welcome! + # Native filesystem for LÖVE nativefs replicates a subset of the [love.filesystem](https://love2d.org/wiki/love.filesystem) API, but without LÖVE's path restrictions. @@ -69,11 +71,12 @@ Function names in this list are links to their LÖVE `File` counterparts. `File` ```lua local nativefs = require("nativefs") --- deletes all files in C:\Windows +-- Prints all information on files in C:\Windows local files = nativefs.getDirectoryItemsInfo("C:/Windows") for i = 1, #files do if files[i].type == "file" then - nativefs.remove("C:/Windows/" .. files[i].name) + local info = nativefs.getInfo("C:/Windows/" .. files[i].name) + print(i .. ": " .. files[i] .. " : Type:" .. info.type .. ", Size:" .. tostring(info.size) .. ", last modified:" .. tostring(info.modtime)) end end ```