Feature request, save/ get file attributes

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Feature request, save/ get file attributes

Post by *LarsSandberg »

Hi, I have looked for a feature/ plugin that is able to save/ restore file-attributes (read only, hidden etc)) as well as timestamps, e.g.: Modified time on all files in a subfolder structure
This could work in a similar way as TC's "Create/ Verify Checksums" under the "File" menu tab, where Checksums are saved into a file
The userinterface could then have an option for saving or restore:
File attributes
Time stamps

I'm working with some 3D-CAD software, often using thousands of referenced files in a subfolder structure
If such subfolder structure is synchronized via dropbox etc. I don't have r/o status, and eventually not the original timestamps on files. During work I will make many of the referenced files as readonly, since they are references, not for modification
In a similar way I would like to be able to restore saved timestamps as well as file attributes again, that could be after migrating CAD data files into a newer version format, which doesn't change the content
If such tool/ plugin/ feature exist, I would be happy to know
If not, the consider this as a feature request
BR Lars
Best regards
Lars
User avatar
petermad
Power Member
Power Member
Posts: 14807
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Feature request, save/ get file attributes

Post by *petermad »

Sounds like a useful feature.

Support+

Topic should be moved to TC suggestions (English)]
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: Feature request, save/ get file attributes

Post by *Gral »

Instal Catalog Maker plugin - http://totalcmd.net/plugring/catalogmaker.html
On first run configure to include dates, times, and attributes in archive file.
Pack all files and directory to archive (this is fake archive - text only file with names and attributes)
Use Synchronize Directory for restore properties - select all files and choose proper option from context menu.
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Re: Feature request, save/ get file attributes

Post by *LarsSandberg »

Thanks for replies
@petermad I will make the feature suggestion
@Gral I tried, it seemed to be what I needed. But during unpack this tool gives a bunch of errors for each file in target dir, then deleting the files ..... :-(
Best regards
Lars
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Feature request, save/ get file attributes

Post by *NotNull »

LarsSandberg wrote: 2020-11-17, 15:26 UTC it seemed to be what I needed.
When you mentioned Time stamps, were you talking about Date Modified times, or also Date Created / Date Accessed times?
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Re: Feature request, save/ get file attributes

Post by *LarsSandberg »

@Notnull , I primarily meant modified time (last write) as mentioned in the OP
But "Created" timestamp could be interesting also, maybe in some cases ....?
Best regards
Lars
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Feature request, save/ get file attributes

Post by *NotNull »

LarsSandberg wrote: 2020-11-17, 17:31 UTC maybe in some cases ....?
I don't know; you are the only one that can tell :) Why do you need to restore the timestamps ?


But ...
In case you *do* need to restore Date Created too: I just threw together another solution, consisting of 2 TC buttons.
One to take a snapshot and 1 to restore the snapshot.
Warning: Largely untested, so don't use it on any real data!

To create these 2 buttons:
  • Copy the button-code to the clipboard
  • Right click on an empty part of TC's button bar
  • Choose Paste
  • Done
(You have to pick your own icons. For now: Hoover with your mouse above a button to reveal it's description)



Button-code Create file properties snapshot

Code: Select all

TOTALCMD#BAR#DATA
powershell.exe
-noprofile -nologo -NoExit -Command  & "{ if (test-path .\file_snapshot.xml) { $YN = read-host 'Take new snapshot? [y/n]'; If ($YN -ne 'y') {exit}};if ((read-host 'Include subdirs? [y/n] ') -eq 'y' ) { $parm = @{Recurse = $true}};gci @parm -Force | select FullName, CreationTime, LastWriteTime, Attributes | Export-Clixml .\file_snapshot.xml ; echo "Done." }
powershell.exe
Create file properties snapshot


-1


Button-code Restore file properties snapshot

Code: Select all

TOTALCMD#BAR#DATA
powershell.exe
-noprofile -nologo -NoExit -Command  & "{If (test-path '.\file_snapshot.xml') { Import-Clixml '.\file_snapshot.xml' | %% { $NEW = gi $_.FullName -Force; $NEW.CreationTime = $_.CreationTime ; $NEW.LastWriteTime = $_.LastWriteTime; $NEW.Attributes = $_.Attributes }; echo "Done."} ELSE { "No snapshot found"} }
powershell.exe
Restore file properties snapshot


-1
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Re: Feature request, save/ get file attributes

Post by *LarsSandberg »

NotNull wrote:Why do you need to restore the timestamps ?
As I wrote in the OP, I can have a bunch of referenced 3D-CAD files in a folder structure where the last edit was years ago, modified timestamp
Since they are in released state (PLM, Product Lifecycle management), they must be read/only and preferably also keep the original timestamp (modified)
Let's say that I need to migrate all CAD files into a never version format (database change)
Then these files need temporary write access for migration
But since data migration doesn't change the older release date, it is important that attribute like read/only or hidden, as well as timestamp (modified) can be restored
It would be great with options/ selection for restore:
- Attributes
- Timestamp, modified
, as selection buttons
In many cases the need is only to restore attributes
Reg Create timestamp, personally I don't see a need for that, but maybe other do?
Best regards
Lars
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Feature request, save/ get file attributes

Post by *NotNull »

If you don't need the Date Created, then you should just go with the Catalog Maker plugin.
If only because it gives you more flexibility (and a GUI :))
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Re: Feature request, save/ get file attributes

Post by *LarsSandberg »

Tried that, but failed as I wrote earlier ....
Best regards
Lars
NotNull
Senior Member
Senior Member
Posts: 269
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Feature request, save/ get file attributes

Post by *NotNull »

Just do as @Gral described:

- Open your "restore" folder in one pane
- Open pack.lst in the other pane (double-click / ENTER )
- Menu:Commands > Synchronize Dirs
- Click Compare button
- Select the files to sychronize in the result list (CTRL+A for all)
- Right-click selection > Copy File Properties ..
- Select the properties to copy (time, attributes)
- OK
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6489
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Feature request, save/ get file attributes

Post by *Horst.Epp »

LarsSandberg wrote: 2020-11-18, 12:39 UTC Tried that, but failed as I wrote earlier ....
You didn't use the right click and select the file properties.
If you just use synchronize it will fail and delete files as you found.
But if you do as Gral suggested it will work !
"Use Synchronize Directory for restore properties - select all files and choose proper option from context menu"
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
LarsSandberg
Junior Member
Junior Member
Posts: 62
Joined: 2003-04-11, 07:46 UTC
Location: Denmark

Re: Feature request, save/ get file attributes

Post by *LarsSandberg »

Hi just some feedback, have used Catalog Maker for some time
I must say that this tool works very well after I learned how to use it :-)
So thumps up for that ;-)
Best regards
Lars
Post Reply