How to generate a manifest file like this ?

antiNT

:)
OP
Member
Joined
Sep 14, 2015
Messages
598
Trophies
0
Location
Doha - Qatar
XP
2,267
Country
Qatar
Hello,
I can't figure out how to generate a manifest file with the following structure : file path: md5 hash: file size (in bytes).
I want to have a txt file who looks like this:
Code:
\ArtOfSword.exe:A3706D489D28D51D8D31A469E36B16BD:159232
\ArtOfSword\ArtOfSword.uproject:D4159C36ECD291B911BDE5662426443E:367
\ArtOfSword\AssetRegistry.bin:07C4B466A707B21363158F10EC59185E:2234259
\ArtOfSword\CookedIniVersion.txt:4193F60033DA1B212101EC44F8F51EFB:1060868
\ArtOfSword\Binaries\Win64\ArtOfSword-Win64-Shipping.exe:1613E07934BE9212BC3A3B2230C2B240:48417280
\ArtOfSword\Config\DefaultEditor.ini:2441CE924D91D6479197CC615B7F213A:29919
\ArtOfSword\Config\DefaultEditorPerProjectUserSettings.ini:F025A5F542DB294F479CF2E3B9ACB15E:73
\ArtOfSword\Config\DefaultEngine.ini:EC738FB227EE884D4C0593E92F43AE55:19907
If you know how to do this please tell me, thanks.
 

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,023
Trophies
1
Location
US
Website
mogbox.net
XP
5,923
Country
United States
Shame you're not doing this on Linux, or some other UNIX system. It's super easy there.
while read x; do

size=${x% *}
file=${x#* }
sum="$(md5sum $file 2>/dev/null)"
sum=${sum%% *} #strip off filename to get sum only*

echo "$sum $file $size"

done <<<"$(find . -type f -printf "%s %p\n")"

Save this as a script, chmod it to make it executable, and run it on whatever directory you want like so.
script.sh /path/to/directory >> whatever.txt

Might work with Cygwin, but I don't have a Windows install to test on.
 

Joom

 ❤❤❤
Member
Joined
Jan 8, 2016
Messages
6,023
Trophies
1
Location
US
Website
mogbox.net
XP
5,923
Country
United States
Bash is easier, and more efficient, than batch, and should actually be able to be ran natively on Windows 10 provided Microsoft's Bash implementation isn't piss poor.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    KenniesNewName @ KenniesNewName: Are Krabby patties fish base