Skip to content

fs.attributes gives bad modified timestamp for directories on windows #396

@JakeTrevor

Description

@JakeTrevor

Describe the bug
The modifed timestamp on windows seems to be bugged.
It works fine for files, but for directories, it keeps ticking up even if no change has been made.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following file:
-- watch.lua
local function watch(fname)
    while (true) do
        sleep(1)
        print(fs.attributes(fname).modified)
    end
end

watch('hello')
  1. create the watched folder e.g. mkdir hello
  2. run bg watch
  3. observe that timestamp continually ticks up, even if folder has not been changed.

Expected behavior
timestamp should only tick up when the folder is actually changed - e.g. a file within it is created, etc.

Environment (please complete the following information):

  • OS: Windows 11
  • OS Version: 24H2
  • CraftOS-PC Version: v2.8.3
  • Compiled from source? No

Additional context
bug does not appear on craftOS-PC web.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions