HitmanExtractor icon indicating copy to clipboard operation
HitmanExtractor copied to clipboard

Directory for every file extension (Better organization)

Open steffalon opened this issue 5 years ago • 4 comments

This will prevent users to fetch everything at once in a single directory.

There is a list that keeps track of all existing file types. After building an entry list, it will create separate directories with extension names.

steffalon avatar Jan 23 '21 22:01 steffalon

Temporary solve: var pathToExtract = $"{outputDirectory}/{fileExtension.ToUpper()}"; if (!Directory.Exists(pathToExtract)) Directory.CreateDirectory(pathToExtract); File.WriteAllBytes(Path.Combine(pathToExtract, $"{fileEntry.Hash:X16}.{fileExtension.ToLower()}"), bytes);

LinkOFF7 avatar Jan 24 '21 13:01 LinkOFF7

@LinkOFF7 Thanks, but that would cause excessive IO checks. @steffalon version is a one-off thing for that.

I'd have to look into the best approach here, even when you put all files in a folder based on their types, some folders would still contain thousands of files.

LennardF1989 avatar Jan 24 '21 14:01 LennardF1989

Maybe like that (begin of ExtractFileEntryList function): foreach(var ext in fileEntryList) { var extension = new string(ext.FileType.ToCharArray().Reverse().ToArray()); Directory.CreateDirectory($"{outputDirectory}/{extension}"); }

LinkOFF7 avatar Jan 24 '21 15:01 LinkOFF7

Maybe creating more sub directories based on 2 hex values of a file name? For example:

/JSON
   /FF
   /0E

steffalon avatar Jan 24 '21 18:01 steffalon