AutoHotkey Community

It is currently May 27th, 2012, 12:08 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: March 9th, 2011, 1:29 am 
Hi people.
Tired of up and down with no answers, a friend suggested me to post here on forums and perhaps a helpful soul could lend me a hand.
I just need a simple cataloging software to replicate files/folders structure of a given drive, being the files actually zero-sized clones having the original attributes and dates intact.
Wouldn't be bad if I had the option to have original size and modification date as part of the pseudo-file name, like this:

SearchGTSetup_Size1_12MB_MOD_02_04_2008_at_23h24min24.exe
Having such info inserted as plain text could be a way, but then they will be no zero-sized anymore... (not a big deal, tho)

Any help is welcome.

I tried nearly each existing catalog tool out there, the closest candidate is Offline CD Browser but it messes up with MScomCTL.ocx and other stuff, and as far as I see it's incompatible with Windows 7. Worse, the great majority of them mixes files and folders when displaying mirrored structure... not good at all. Another pro in favor of OCDB: it produces clean, nearly plain text in catalogs so it can be easily searched by file indexers.

Hope this can be useful to anyone - some stuff I came across when searching:
(as I said, they can be wonderful for cataloging in general, but none matched my simple need to duplicate file structure! And yes, I tested each and every one in this list. Ouch...)

2altFiles
AdvancedDiskCatalog
AdvancedFileOrganizer
CamelDiskCatalog2
CatalogMaster
cathy
DiskExplorerPro
FileCataloger
FileListBuilder
FileNameChanger
FileStructureGrabber
Gentibus
iceCDInfo
InsideCAT - awesome!
Manxam_DiskCatalog - this one is great, as per their video demo on site!
MyDVDcatalog
OfflineCDBrowser
SambaProfessional
SearchBackups
VisualCD
WhitecloudsoftFolderContentMakerPro 2_0
WinCatalog

AdvancedFileOrganizer.htm
DiskInspector.htm
FileCataloger.htm
FileTreeModel.html
haxial-diskcatalog-81431.html
MTree_search.htm
myfiles.html

Argentum_MyFiles_4459_SHAREW.exe
cdlist.zip
csp_install.exe
di_setup_SHAREW.exe
disclib_install_v2.0.exe
jdirprint.zip
Primitive-Disk-Indexer.exe
SetupFileCataloger_English_v2_1_0_Release_Build_24.exe


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2011, 10:24 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
Why not make your own with AHK, look at the File* commands and the example and you should be able to get what you want in a small script.

AHK Commands & Functions:
http://www.autohotkey.com/docs/commands.htm
Look at the File* and Loop (Files & Folders)

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2011, 11:51 am 
Offline

Joined: February 19th, 2010, 8:07 pm
Posts: 615
yup you can create your own with AHK in no time.
Also i will point out that if you are using XP-Vista-Win7 or any OS that belong to their family you can store information on File Streams.

That way you can have the information stored with the file without affecting its size.

It is used very often by programs to store keywords, tags, or file information like author and stuff like that.

they are very easy to use, and there are examples all over the net.

main info:
http://msdn.microsoft.com/en-us/library/aa364404

_________________
Main Project: AutoHotkey Toolkit
Unless specified otherwise all my code is written for the latest Autohotkey L Unicode version.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2011, 4:18 pm 
Hi hugov and RaptorX.
I'm not a programmer, so this would be a dream to me.
Can one of you help me on this, then...?
It really seems to be simple (read file's dates attribs, clone file structure, append that info in the newly created zero-sized file) but I tried to understand the basics of GUI and I'm still lost in the woods.
Not to mention the time frame, but that's another question.
So please, feel free to help.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2011, 4:30 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
No need for GUI as far as I can see.

For an ALL AutoHotkey solution you need:

- FileSelectFolder to select Source Directory (can be CD/DVD)
- FileSelectFolder to select Target Directory
- Loop (files & folders) include folders & recurse (use the built-in vars for the filenames)
- FileGetSize, FileGetTime to get file properties and to append to filename [EDIT: use the built-in variables like uberi does below, completely forgot about these as I never used them]
- FileCreateDir to create directories
- FileAppend to create empty files with filename+data

OR do a simple "dir /s > list.txt" to create a text file with filenames, properties, dir structure and parse that file to create the cloned structure

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)

Start with the tutorial to learn the basics of AutoHotkey and give it a go, post some code if you get stuck somewhere, if you break it down into little steps you should be able to do it

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Last edited by SoLong&Thx4AllTheFish on March 23rd, 2011, 11:31 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2011, 11:00 am 
I was excited when I saw the first dialogs (not custom, so they pop no clue on what's being chosen for what...), but then... nothing.

FileSelectFolder, start, C:\
FileSelectFolder, target
Loop
FileGetSize, fsize
FileGetTime, ftime
FileCreateDir, % start
FileAppend, , % start_% fsize_% ftime

Also, I saw no way to get the format SearchGTSetup_Size1_12MB_MOD_02_04_2008_at_23h24min24.exe, something like % start . _ . Size . % fsize(flexible) . _ . MOD . _ . $ ftime(dd_mm_yyyy . at . hh . h . nn . min . ss).ext (if available)

And you practically told me everything I need to know to get the job done, as it seems... tsc, tsc...

And remember - it's not a matter of registering that info on a file, it's actually an attempt to clone the file structure, preserving dates in pseudo-files and folders while having size (of files) and mod date appended to original name as a visual quick hint, being those pseudo-files zero-sized files or simple .txt-in-disguise containing basic info of its real counterpart (file name, file size in bytes and rounded/flexible, full date attribs).

I have seem many excellent projects here on the forums, by the way. You guys are great with an awesome creation tool, congrats!

Sorry and thanks for the tips.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2011, 5:10 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
What I wrote above wasn't the script, but the commands you would need and almost in the order you would need them as well. You said "so they pop no clue on what's being chosen for what" which is why there is documentation and there you will see there is a PROMPT option

Code:
FileSelectFolder, start, c:\, , Select your source folder


look at each command, look at the examples, string them together and you will have your script, you can use AHK for many more things then this so it will be time well spent learning it in my opinion, but start somewhere, break each command in a small test script to see what it does and how it works before merging them together.

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 12th, 2011, 8:33 pm 
Hi, hugov.
Sorry me, I'm just a user trying to get a task done and went here because of a friend's indication. He had an issue and someone solved the problem just like that. My bad luck, I guess?
As I can see this is almost a programming language that seems to be easy for the insiders, I did my best writing after help, reading Help file, doing forum search and trying to combine what you posted. You see there's a result, but far away from getting the final result.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 21st, 2011, 3:29 pm 
this is cool and actually i have a similar need, so i'd like to vote or ask for, don't know how things happen here to obtain such a tool too.
i'm looking for a quick way to copy my online machines and revise their contents in my offline notebook while i'm off for a trip, so i could quickly do my backups instead of losing time over and over again.
if i had the actual size of files displayed along with their names the way it's described that would be xtremely useful.
so thnxs in advance.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 23rd, 2011, 8:49 pm 
Offline
User avatar

Joined: August 23rd, 2010, 6:22 pm
Posts: 781
Location: Ontario, Canada
Code:
MirrorFolder(SourceFolder,DestFolder)
{
 Loop, %SourceFolder%, 1
  PathLen := StrLen(A_LoopFileLongPath) + 1
 Loop, %SourceFolder%\*, 1, 1
 {
  Path :=  DestFolder . SubStr(A_LoopFileLongPath,PathLen)
  If InStr(FileExist(A_LoopFileLongPath),"D")
   FileCreateDir, %Path%
  Else
   FileAppend,, %Path% (%A_LoopFileSizeMB% MB) (Modified at %A_LoopFileTimeModified%)
 }
}


Untested.

_________________
AutoHotkey.net | GitHub

My default license.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2011, 11:16 pm 
Hello, Uberi.
Thanks for trying.
By lloking at it and trying to guess what is what, the code seems to make sense but haven't tried. Looking at your sig gave me a clue that I should test the code on both versions of AHK and... nothing.
Thought about adapting it with my first attempt, ended with

Code:
FileSelectFolder, SourceFolder, C:\
FileSelectFolder, DestFolder
MirrorFolder(SourceFolder,DestFolder)
{
 Loop, %SourceFolder%, 1
  PathLen := StrLen(A_LoopFileLongPath) + 1
 Loop, %SourceFolder%\*, 1, 1
 {
  Path :=  DestFolder . SubStr(A_LoopFileLongPath,PathLen)
  If InStr(FileExist(A_LoopFileLongPath),"D")
   FileCreateDir, %Path%
  Else
   FileAppend,, %Path% (%A_LoopFileSizeMB% MB) (Modified at %A_LoopFileTimeModified%)
 }
}

but still no luck.
:cry:
Thanks for trying to help.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2011, 11:22 pm 
Offline
User avatar

Joined: August 23rd, 2010, 6:22 pm
Posts: 781
Location: Ontario, Canada
Here's a working version:

Code:
FileSelectFolder, SourceFolder, C:\
FileSelectFolder, DestFolder
MirrorFolder(SourceFolder,DestFolder) ;this is a function call, it tells the function "MirrorFolder" to run

MirrorFolder(SourceFolder,DestFolder) ;this is a function definition, so it doesn't get executed unless you tell it to
{
 Loop, %SourceFolder%, 1
  PathLen := StrLen(A_LoopFileLongPath) + 1
 Loop, %SourceFolder%\*, 1, 1
 {
  Path :=  DestFolder . SubStr(A_LoopFileLongPath,PathLen)
  If InStr(FileExist(A_LoopFileLongPath),"D")
   FileCreateDir, %Path%
  Else
   FileAppend,, %Path% (%A_LoopFileSizeMB% MB) (Modified at %A_LoopFileTimeModified%)
 }
}


Edit: it should work on all versions of AHK

_________________
AutoHotkey.net | GitHub

My default license.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2011, 11:58 pm 
Hello, Uberi!
:D THANK YOU!!! :D
Playing with the code a bit I managed to produce a version that only copies folder structure or simple file cataloging in the sense of recreating folder/file structure without the extra info. Any user which may want this and can't figure it out, just leave a post. It's not hard: play with the last lines of the code, disabling or deleting what you want and you will get what you want.

BUT: can you provide me a code which preserves (reproduces, duplicates...?) the time and system attributes on the newly created files themselves, being practically a 1:1 cloning of the original file structure (zero-sized files, of course!)?
This is key for the project which is a kind of a "quick supervisor tool", which seems to be extended by the other user "visitor" as he said (nice idea, by the way - it may be useful to me also, will consider its usability and implications).
Again - THANKS!!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2011, 12:17 am 
Ooops, just noticed - the tool is not reading ORIGINAL file size and appending that in file names... Instead, it's reporting size "0 MB" for all the files.
Also, "20101022190402" is not that "human friendly" like SearchGTSetup_Size1_12MB_MOD_02_04_2008_at_23h24min24.exe - is there a way to fraction the info like that?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 25th, 2011, 12:34 am 
Offline
User avatar

Joined: August 23rd, 2010, 6:22 pm
Posts: 781
Location: Ontario, Canada
All done :D:

Code:
FileSelectFolder, SourceFolder, C:\
FileSelectFolder, DestFolder
MirrorFolder(SourceFolder,DestFolder) ;this is a function call, it tells the function "MirrorFolder" to run

MirrorFolder(SourceFolder,DestFolder) ;this is a function definition, so it doesn't get executed unless you tell it to
{
 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
   FileAppend,, %Path% (%A_LoopFileSizeKB% KB) (Modified at %ModifyTime%)
   FileSetAttrib, +%A_LoopFileAttrib%, %Path%
   FileSetTime, %A_LoopFileTimeModified%, %Path%, M
   FileSetTime, %A_LoopFileTimeCreated%, %Path%, C
   FileSetTime, %A_LoopFileTimeAccessed%, %Path%, A
  }
 }
}


NOTE: Untested.

Copies file attributes, times, and sizes. Time is segmented into easily readable format.

_________________
AutoHotkey.net | GitHub

My default license.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group