Prusa-firmware: Files on SD card: The sort should be using the modified date

Created on 15 Feb 2018  路  8Comments  路  Source: prusa3d/Prusa-Firmware

Hi,

The implementation of https://github.com/prusa3d/Prusa-Firmware/issues/169 isn't quite correct.

The actual Sort by Date referenced in the above issue sorts the files using the Creation date but it must use the "Modified" date because we want to have at top the newest (latest modified) files.

Most helpful comment

PR tagged for firmware 3.9.x!

All 8 comments

That is why I get wired sorts when overwriting files on the AirFlash SD. Doing that a lot when designing new models.
I second that suggestion.

Fully support this, see my thread here, spent a day repeatedly printing a slightly modified file until I noticed the file at the top of the list wasn't my modified file!

Hello,

The issue is the code uses creationDate and creationTime for sorting purposes (among others) in Firmware/cardreader.cpp - the original assignment can be found here.

I don't understand the other usages of these variables in the file, but the uses within CardReader::presort() (definition starts here) could probably be adjusted to use modification times instead. You'd need to modify CardReader::lsDive() to supply those in addition to creation time, if you wanted to do this without changing those other references.

I do not yet have a printer of my own or I'd build and test a patch for a PR, but hopefully this helps someone else do so!

(note: i am linking to eea7554 which is the current head of the MK3 branch)

PR #1739 submitted - this fixes it on my MK3S.

Well, this has been sitting unreviewed since I submitted the PR. I'm sorry :(

Wish I knew how to get eyes on this.

I suspect it's not seen as a high priority as the default file name out of Prusa Slicer has changed to include the expected duration of the print and hence the file name is very likely indeed to change between iterations of the same job.

Of course this fix IS still required since there are those of us who prefer to stick with the same file name rather than fill our SD cards with a gazillion things that have slightly different names where the difference in the name is not visible off the left of the LCD display anyway!

Very-very useful!

PR tagged for firmware 3.9.x!

Was this page helpful?
0 / 5 - 0 ratings