Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

(Tired of) looking for a catalog tool.


  • Please log in to reply
27 replies to this topic
Cataloguer
  • Guests
  • Last active:
  • Joined: --
Hello, Uberi. Thanks for taking the trouble.

Code wasn't creating files due to formatting,
FormatTime, ModifyTime, %A_LoopFileTimeModified%, hh-mm-ss tt`_dd-MM-yyyy
fixes the problem. Now it reports sizes on name :D , but even after inserting a "+" after each "FileSetTime, " section I can't clone timestamping on newly created "pseudo-files".
> What's the function of the "tt' " part? Removing it seems to have no impact, but I tested both formats - with and without it.

I was unable to write something like "hh . "h" . -mm . "min" -ss" so I could have "23h24min24" as output, if this is possible fine, otherwise I can live with that as it is.

Is there a way to have a flexible value instead of fixed KB? Like 8 bytes > 999 KB > 10 MB > 1 GB, depending on the size of the source file?

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
The "tt" indicates either "AM" or "PM", as the code was using the 12 hour clock.

Regarding your issues with timestamp cloning, I'm guessing that it is probably the "FileSetTime". I've always had troubles with that command in the past, where it would stop working on a seemingly random basis. Not sure what can be done about that.

This version will use a smarter file size display:

FileSelectFolder, SourceFolder, C:\
FileSelectFolder, DestFolder
MirrorFolder(SourceFolder,DestFolder)

MirrorFolder(SourceFolder,DestFolder)
{
 Units = GB|GiB|1000000000,MB|MiB|1000000,KB|KiB|1000,|Bytes|1
 Loop, %SourceFolder%, 1
  PathLen := StrLen(A_LoopFileLongPath) + 1
 Loop, %SourceFolder%\*, 1, 1
 {
  Path :=  DestFolder . SubStr(A_LoopFileLongPath,PathLen), FileAttributes := FileExist(A_LoopFileLongPath)
  If InStr(FileAttributes,"D")
   FileCreateDir, %Path%
  Else
  {
   FormatTime, ModifyTime, %A_LoopFileTimeModified%, h:mm:ss tt  dd/MM/yyyy
   Loop, Parse, Units, `,
   {
    StringSplit, Temp, A_LoopField, |
    Temp1 := A_LoopFileSize%Temp1%
    If (Temp1 < Temp3)
     Break
   }
   FileAppend,, %Path% (%Temp1% %Temp2%) (Modified at %ModifyTime%)
   MsgBox "%Path% (%Temp1% %Temp2%) (Modified at %ModifyTime%)"
   FileSetAttrib, +%A_LoopFileAttrib%, %Path%
   FileSetTime, %A_LoopFileTimeModified%, %Path%, M
   FileSetTime, %A_LoopFileTimeCreated%, %Path%, C
   FileSetTime, %A_LoopFileTimeAccessed%, %Path%, A
  }
 }
}


ArchCarrier
  • Members
  • 39 posts
  • Last active: Jul 31 2015 01:19 PM
  • Joined: 03 Jun 2008
If you use Total Commander as your file manager, there is a plugin called Diskdir which lets you pack any folder you like into a .lst file (basically a zip file containing just the file info). When you click it, it shows the exact structure of the folders you packed, including icons, file sizes, dates and so on.

Cataloguer
  • Guests
  • Last active:
  • Joined: --
@ArchCarrier
Thanks for the heads up, going after it right now!

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007

If you happen to use Total Commander, there is an addon DiskDir (Extended) that do something similar which can be searched by TotCmd like ZIP files (they are essentially plain text files like a dir /s)

:?: :!: :evil:

Cataloguer
  • Guests
  • Last active:
  • Joined: --
@hugov
Don't be so mad at me... by the time of your post I thought I could have a better result under .ahk, now I am open to any other solution since there are gaps that .ahk may not cover totally, as per what Uberi said.

242
  • Guests
  • Last active:
  • Joined: --

...

This version will use a smarter file size display:

FileSelectFolder, SourceFolder, C:\
FileSelectFolder, DestFolder
MirrorFolder(SourceFolder,DestFolder)

MirrorFolder(SourceFolder,DestFolder)
{
 Units = GB|GiB|1000000000,MB|MiB|1000000,KB|KiB|1000,|Bytes|1
 Loop, %SourceFolder%, 1
  PathLen := StrLen(A_LoopFileLongPath) + 1
 Loop, %SourceFolder%\*, 1, 1
 {
  Path :=  DestFolder . SubStr(A_LoopFileLongPath,PathLen), FileAttributes := FileExist(A_LoopFileLongPath)
  If InStr(A_LoopFileAttrib,"D")
   FileCreateDir, %Path%
  Else
  {
   FormatTime, ModifyTime, %A_LoopFileTimeModified%, h:mm:ss tt  dd/MM/yyyy
   Loop, Parse, Units, `,
   {
    StringSplit, Temp, A_LoopField, |
    Temp1 := A_LoopFileSize%Temp1%
    If (Temp1 < Temp3)
     Break
   }
   FileAppend,, %Path% (%Temp1% %Temp2%) (Modified at %ModifyTime%)
   FileSetAttrib, +%A_LoopFileAttrib%, %Path%
   FileSetTime, %A_LoopFileTimeModified%, %Path%, M
   FileSetTime, %A_LoopFileTimeCreated%, %Path%, C
   FileSetTime, %A_LoopFileTimeAccessed%, %Path%, A
  }
 }
}


The smarter code doesnt work for me.
Neither the attributes part.

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
What version of AHK? What happens? Does the script run at all? Is it run in a folder that requires additional permissions to access?

242
  • Guests
  • Last active:
  • Joined: --
Using AutoHotkey_L_Install.exe
The script runs, but the folders and files seems to not have names correctly named after each measurement unity. Only folders are created and the expected would be to have files and folders cloned at the target directory.
No, operations are run locally by admin under XP.

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Could you give an example of a filename that was created?

242
  • Guests
  • Last active:
  • Joined: --
It's just creating the folders 1:1.

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010
Try rerunning the above code, what does the MsgBox show? Does it work when the MsgBox is removed?

242
  • Guests
  • Last active:
  • Joined: --
Tehre's no msgbox in the code?
Run it again with same problem.