Jump to content
RealModScene
Sign in to follow this  
omcdsijfnu8h75ztrg

"Refreshing" the hard drive

Recommended Posts

Hi there,

my Xbox is getting old and I'm afraid the data on its 1000 GB harddrive might detoriate. To make sure that doesn't happen, I'm planning to write a Lua script that reads every single file on the disk and writes it back under the same name.

I understand this should be possible to do with Aurora's Lua scripting, right? Anyone else ever did this before? Any tips on how to write that script? I know Lua and don't need basic help with that, I'm just not sure about the Xbox filesystem architecture and if there's any pitfalls that I should be aware of.

Btw, it's Lua. Not LUA. Not an acronym. Lua people are very sensitive about that, lol.

Share this post


Link to post
Share on other sites

All right, this is so helpful.

local function refreshFiles(path)
local files = FileSystem.GetFiles(path .. '\\')
for _, file in pairs(files) do
print("refresh file " .. _ .. " " .. file.Name)
end
for _, dir in pairs(FileSystem.GetDirectories(path .. '\\')) do
refreshFiles(path .. '\\' .. dir)
end
end

function main()
for _, drive in pairs(FileSystem.GetDrives()) do
refreshFiles(drive.MountPoint)
end
end

Why does this code print nothing? What are you supposed to pass to FileSystem.GetFiles and FileSystem.GetDirectories, because they always return nil.

Edit: what the fuck, lol. Sorry for the mess with the code, this forum sucks

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...