lune-org/lune

Provide functionality to retrieve file/folder metadata through the fs lib

Closed this issue · 1 comments

Currently there is no way to retrieve file metadata such as creation/modification date, file/folder sizes, and the like. At present Lune does not provide a method to get this information and a workaround is using powershell (or otherwise) and the "Get-Item" command, this does work to a point - retrieving the modification date & file size in bytes, though it's not nearly everything.

My use-case for this is to 'diff' two files (an asset and a place) to ensure that a file that's been modified will be updated and synced so long as it's modification date precedes the last modification date of a target place file, this would then allow me to move away from the not-so-agnostic powershell 'Get-Item' command, and also provide even more useful information.

It would also be helpful if the DateTime library came with this change so parsing of the dates is easier, attached is my solution to the DateTime and file metadata problem (thought do note these files are from when lune was moderately fresh and I was learning the ropes), the main file (for this issue) is canSyncAsset.luau though to understand it's use I've provided the full sync and build scripts for context.
sync scripts.zip

Implemented in bca3de9 , will be in the next release