GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
Does anybody know a way to get all files in a directory (using Wildcard * or *.*) with HDFmonkey.exe out of a .HDF-Image? I can only get single files, but not a whole directory.
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
@Luzie,
Can I suggest HDFMGooey? It's not perfect, but is good for copying masses of files and directories.
Or, did you answer the question here?
https://forum.tlienhard.com/phpBB3/view ... 406#p50195
Can I suggest HDFMGooey? It's not perfect, but is good for copying masses of files and directories.
Or, did you answer the question here?
https://forum.tlienhard.com/phpBB3/view ... 406#p50195
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
Dear @PeterJ. as HDFMGooey is internally using HDFmonkey.exe it too can only put a whole directory into the image, but cannot get a whole directory including files in that directory back.
Also on:
...sadly the same: Only put a whole directory and not get of a whole directory.PeterJ wrote: ↑Tue Sep 20, 2022 7:26 pm Or, did you answer the question here?
https://forum.tlienhard.com/phpBB3/view ... 406#p50195
Maybe we can write a script to process the file-list we get with "HDFmonkey ls HDF-File.HDF directoryname" which lists all filenames in a directory
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
@Luzie,
I'm sure I read that HDFmonkey can't handle empty directories which sounds linked to this. Your solution sounds like a great one.
PS, I was aware that HDFMGooey used HDFmonkey, but hadn't tried the bulk copy off the image. Apologies.
As mentioned previously, I wish it was possible just to mount an HDF image as a drive in Windows and just move files like you can with an SD card.
I'm sure I read that HDFmonkey can't handle empty directories which sounds linked to this. Your solution sounds like a great one.
PS, I was aware that HDFMGooey used HDFmonkey, but hadn't tried the bulk copy off the image. Apologies.
As mentioned previously, I wish it was possible just to mount an HDF image as a drive in Windows and just move files like you can with an SD card.
- Alessandro
- Dynamite Dan
- Posts: 1910
- Joined: Wed Nov 15, 2017 11:10 am
- Location: Messina, Italy
- Contact:
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
I think you can only extract one single file at a time from HDF disk image files. At least that's what happens with the HDFM-Gooey graphical user interface. The help given by typing "hdfmonkey help get" also mentions a single file and no wildcards so it seems to be like that.
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
@Alessandro Thank you. I didn´t recognize that:Alessandro wrote: ↑Wed Sep 21, 2022 3:01 pm The help given by typing "hdfmonkey help get" also mentions a single file and no wildcards so it seems to be like that.
In the meantime I found a solution using a Windows Batchfile. This can get all files from a specified directory (but not Sub-Directories of this directory).hdfmonkey.exe help get
get: Copy a file from the disk image to a local file
usage: hdfmonkey get <imagefile> <sourcefile> [destfile]
Will write the file to standard output if no destination file is specified.
It utilize the output of the HDFmonkey "ls" command which is e.g.:
Code: Select all
hdfmonkey.exe ls hdfmaker.hdf dot
685 checkerb
7260 ESPBAUD
[DIR] extra
8192 http
51200 odin
8192 ping
8192 wc
Code: Select all
REM Extract_all_Files_from_one_Directory_of_a_HDF-Image-File.BAT
REM Does not extract files in SubDirectories of the selected Directory
REM v0.01 by Luzie
SET hdfmonkeyexe=hdfmonkey.exe
SET hdffilename=HDFMaker.HDF
SET Directory-Name=dot
%hdfmonkeyexe% ls %hdffilename% %Directory-Name% > DIR-TEMP1.TXT
REM Delete all Lines containing [DIR]
type DIR-TEMP1.TXT | find /v "[DIR]" > DIR-TEMP2.TXT
for /f "tokens=2" %%i in (DIR-TEMP2.TXT) do echo %%i >> DIR-TEMP3.TXT
MD %Directory-Name%
for /f "tokens=2" %%i in (DIR-TEMP3.TXT) do HDFmonkey.exe get %hdffilename% %Directory-Name%\%%i %Directory-Name%\%%i
REM get
for /f %%i in (DIR-TEMP3.TXT) do HDFmonkey.exe get %hdffilename% %Directory-Name%\%%i %Directory-Name%\%%i
DEL DIR-TEMP1.TXT
DEL DIR-TEMP2.TXT
DEL DIR-TEMP3.TXT
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
Life could be easier if we use the right tools ...
While doing some research to extract a complete Directory/Subdirectory-Tree I discovered on: https://superuser.com/questions/321829/ ... mmand-line that 7-Zip not only can unpack a whole .HDF or .RAW-HDF-Image-FIle, but even a SubDir or selected files from it.
So the easy solution for extracting a complete Directory-Tree to an Output-Directory called "Outputdir" could be:
While doing some research to extract a complete Directory/Subdirectory-Tree I discovered on: https://superuser.com/questions/321829/ ... mmand-line that 7-Zip not only can unpack a whole .HDF or .RAW-HDF-Image-FIle, but even a SubDir or selected files from it.
So the easy solution for extracting a complete Directory-Tree to an Output-Directory called "Outputdir" could be:
Code: Select all
7z.exe x NameofHDFFile -oOutputdir DirectoryNameInHDFFile
Re: GET all files in a directory (using Wildcard * or *.*) with HDFmonkey out of a .HDF-Image
It maybe easier to directly drag and drop files into a .HDF-File with this Windows Batchfile:
You can drop (one) file on this example-Batchfile and it´s written to HDF-Image-Files even if they are opened/running in an Emulator:
Code: Select all
REM Drag_and_Drop_to_Directory_TESTS_in_HDF-Files_HDFMAKER.HDF_and_HDFMAKER.RAW.bat
REM v0.11, Luzie
SET hdfmonkeyexe=hdfmonkey.exe
SET Destination-Directory=\TESTS
%hdfmonkeyexe% mkdir HDFMAKER.HDF %Destination-Directory%
%hdfmonkeyexe% mkdir HDFMAKER.RAW %Destination-Directory%
REM Drag and drop files into batch file
REM https://www.dostips.com/forum/viewtopic.php?t=7783
@echo off
setlocal enableExtensions disableDelayedExpansion
REM if using more than 9 arguments you may use the "shift" command
REM echo Command line: %0 %*
REM echo Command line argument 1: "%~1"
REM https://ss64.com/nt/syntax-args.html
REM The modifiers above can be combined: ~nx2 Expand %2 to a file name and extension only.
echo Command line argument 1: "%~nx1"
%hdfmonkeyexe% put HDFMAKER.HDF "%~1" "%Destination-Directory%\%~nx1"
%hdfmonkeyexe% put HDFMAKER.RAW "%~1" "%Destination-Directory%\%~nx1"
endlocal
goto :eof