cnvogelg / amitools

Various tools for using AmigaOS programs on other platforms
250 stars 69 forks source link

xfdtool write dir without creating dir #196

Closed wepl closed 4 months ago

wepl commented 5 months ago

I like to write directories with files contained using xfdtool. It seems it is not possible to do this without creating the directory specified as source: mkdir c touch c/a rdbtool -fv x.hdf create size=1000k + init + add size=100% name=BOOT xdftool x.hdf format boot ffs + write c + write c + list gives: boot VOLUME -------- 16.02.2024 12:05:21.00 DOS1:ffs #512 c DIR ----rwed 16.02.2024 12:05:21.00 a 0 ----rwed 16.02.2024 12:05:21.00 c DIR ----rwed 16.02.2024 12:05:21.00 a 0 ----rwed 16.02.2024 12:05:21.00 It would be conventient to be able to write multiple files without creating a directory. I like to create a hdf from multiple source directories which is complicated ATM. Thanks.

wepl commented 5 months ago

I see this is partial doable with the pack command. But it only works if a directory does not yet exists. Otherwise it fails, e.g.: 'pack boot.dbg' FSError: Name already exists(10):node=ADFSVolDir:''(@960),file_name=c So it would also help if pack would not complain about existing directories.

cnvogelg commented 4 months ago

Hi,

I see your point. I have added a solution in 2268b1e that should do the trick: In read and write commands you can add the new add option: If the target is a directory then the source directory will not be created but the target dir is used directly...

For a source file tree

c1/
  foo
c2/
  bar

with the command

write c1 c + write c2 c add

you get now on the image:

 c/
  foo
  bar

Does this help for you?

wepl commented 4 months ago

Thanks a lot. This is working fine now.