PDA

View Full Version : Keep folder timestamp on downloads


kebrank
06-06-2015, 03:08 PM
Hello,
Would be possible to add an option to keep the timestamps of folders when downloading? I know this would not work from server to server but should be possible downloading locally.
Thanks,
\o/.k,

bigstar
06-07-2015, 10:11 AM
This is not as simple as it would appear, the date/time would need to be set after all of the content within the folder is transferred. If the date/time only needed to be set when creating the folder then it would be much easier but changes with the folder will update the modified date/time of the folder undoing our work. (FlashFXP shows the modified date of a folder, this is done to match the logic of remote servers that report the modified timestamps)

Is there a specific reason why you want to sync the folder date/time to match the server?

kebrank
06-07-2015, 10:48 AM
Yes, the date should be changed after the last file of that folder was downloaded. Maybe a folder timestamp sync feature that you could run anytime after the transfers are done would be more feasible.

Several people have asked before about this functionality. I think since you can preserve the file timestamps it makes sense you could also preserve the folder timestamps. For archiving purposes you want to keep folder dates to have an idea about how old they are without having to go into each folder and look at the files timestamps. It's the same thing that transfering folders and files from one drive to another one. Sometimes you want to keep the original timestamps for different reasons.

Thanks,
\o/.k.

bigstar
06-08-2015, 01:50 PM
Rather than using the folder timestamp from the server, what if we simply determine the modified timestamp base on the newest file or folder within it?

If you have a folder named c:\test\ and the newest file has a timestamp of "2010-01-01 12:00" then the modified timestamp of \test\ would be updated to use this timestamp.

In many cases this would not match the server folder \test\ modified timestamp which is updated any time a file is moved/renamed/deleted, but instead it would reflect the timestamp of the last modified file within it.

This way we could avoid sending additional commands to the server and it would work whether or not the server supported the MTDM command.

This method could perhaps also be made into a custom command macro that could be used manually on existing local folders, not sure what I'd call it though /SetFolderTimestampToNewestFile %p%f is too long, suggestions welcome. Perhaps an optional [-r] flag to set the folder timestamps recursively as well.

kebrank
06-13-2015, 02:26 PM
Thank you for your reply. I think it's a good idea. Could it be set to get the Created timestamp from the oldest file/folder and the Modified/Accessed timestamp from the newest file/folder?

\o/.k.

bigstar
06-17-2015, 04:10 PM
I've added a new macro command to set the folder created date and modified date

You can test them out in this build

Download FlashFXP51_3851_Setup.exe (http://www.flashfxp.com/testr/dev-builds/FlashFXP51_3851_Setup.exe)

Download FlashFXP51_3851_Portable.exe (http://www.flashfxp.com/testr/dev-builds/FlashFXP51_3851_Portable.exe)

/setfolderdate -r <path>

use the -r flag to apply the operation recrusively, or drop it to apply only to <path>

kebrank
06-17-2015, 07:52 PM
I have to say this is a dream come true. It works perfect and it's very very fast :)
My last question is if could be possible to add a second command to change just the modified date.

Thank you so much.

\o/.k.

bigstar
06-18-2015, 10:24 AM
I have revised the command to make the default behavior only update the modified date and added a new flag to optionally update the created time.
The previous build also had an issue where it was applying the operation recursively even when when the -r flag was omitted.

/setfolderdate [-rc] <path>

This local command can be used to set the modified date of a folder to the newest item within the folder.
The r flag can be used to perform the operation on <path> and recursively to all sub-folders within <path>
The c flag will update the creation date to the oldest item within the folder.



Download FlashFXP51_3852_Setup.exe (http://alt-download.flashfxp.com/FlashFXP51_3852_Setup.exe)



Download FlashFXP51_3852_Portable.exe (http://alt-download.flashfxp.com/FlashFXP51_3852_Portable.exe)

kebrank
06-30-2015, 07:32 PM
Sorry for the delay. I just tested it today and worked perfect. I ran all the possible combinations and didn't find any issues.
Thank you so much for this great update.
\o/.k.