Old 06-06-2015, 03:08 PM   #1
kebrank
Junior Member
FlashFXP Registered User
 
Join Date: Aug 2010
Posts: 11
Default Keep folder timestamp on downloads

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,
kebrank is offline  
Old 06-07-2015, 10:11 AM   #2
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

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?
bigstar is offline  
Old 06-07-2015, 10:48 AM   #3
kebrank
Junior Member
FlashFXP Registered User
 
Join Date: Aug 2010
Posts: 11
Default

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.
kebrank is offline  
Old 06-08-2015, 01:50 PM   #4
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

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.
bigstar is offline  
Old 06-13-2015, 02:26 PM   #5
kebrank
Junior Member
FlashFXP Registered User
 
Join Date: Aug 2010
Posts: 11
Default

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.
kebrank is offline  
Old 06-17-2015, 04:10 PM   #6
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

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

Download FlashFXP51_3851_Portable.exe

/setfolderdate -r <path>

use the -r flag to apply the operation recrusively, or drop it to apply only to <path>
bigstar is offline  
Old 06-17-2015, 07:52 PM   #7
kebrank
Junior Member
FlashFXP Registered User
 
Join Date: Aug 2010
Posts: 11
Default

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.
kebrank is offline  
Old 06-18-2015, 10:24 AM   #8
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

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.

bigstar is offline  
Old 06-30-2015, 07:32 PM   #9
kebrank
Junior Member
FlashFXP Registered User
 
Join Date: Aug 2010
Posts: 11
Default

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.
kebrank is offline  
Closed Thread

Tags
server, downloading, work, locally, downloads, timestamp, folder, add, folders, timestamps

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 04:29 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)