XboxDev / extract-xiso

Xbox ISO Creation/Extraction utility. Imported from SourceForge.
http://sourceforge.net/projects/extract-xiso/
Other
679 stars 86 forks source link

Ubuntu/linux batch command #84

Closed diicasses closed 1 year ago

diicasses commented 1 year ago

Anyone know a batch script/command to extract a bunch of folders?

sharkwouter commented 1 year ago

You'll have to be much more specific. If you just want the content of folders to be shown, you can just use ls -R.

If you want something more complex, you'd do something like this:

find ./ -type f -name "*.extension" -exec command {} \;

You'd replace extension with whatever type of file to wish to extract and command with the command you want to apply to the file. I'd assume we're talking unzip, tar or gzip or something here. Take a good look at the man of these commands if so.

This issue should probably be closed, though, as it's not really relevant to this project from what I can tell.

diicasses commented 1 year ago

Just go from .XBE HDD folder > to .ISO.

So process a bunch of games at once into .ISOS into their respective folders or an output in the main folder.

JayFoxRox commented 1 year ago

This has nothing to do with extract-xiso (or Ubuntu for that matter).

Also, let me preface this, by saying that extract-xiso is the wrong tool for the job / your job is a bad idea.

By extracting an XISO, you'll have lost the layout of the files on the disc. That is important for performance characteristics and occasionally things like copy-protection.

Even for emulators this will likely become relevant in the future.

FATX (where xiso most often ended up) also allows different filenames from XISO, so you might have created problems in the process. Also see #81. Many tools running on the Xbox, when dumping to directory, will also apply cracks/patches to games. When serving from a harddisk / flashdrive, performance is not relevant, but when going back to XISO (which is meant for discs), this can be problematic.

Hence, once an XISO is extracted, you should never repack it. Most official games came as XISO - you should not repack them.

Generally, you should stick to redump style ISOs for official games. You should only use tools like extract-xiso for creating XISOs for your own applications/modded games (and even there, extract-xiso is very poor because you can't specify things like the disc-layout / keep changes minimal).

Obviously some exceptions for what I said above exist, but it sounds like you have a bunch of commercial games and want to turn them into XISO again after having them extracted previously: That's a bad idea.


To answer your question:

for foldername in */; do; echo $foldername; done

Anything between do and done will be run for each folder in the current directory.


Take anything below with a grain of salt, because I don't have extract-xiso installed right now, so this is guesswork based on the README

I assume you'll want something like:

for foldername in */; do; echo extract-xiso -c "$foldername" "$(basename $foldername).iso"; done

(the echo is for debugging purposes and needs to be removed)

Also, for completeness, you'd use this for extracting all of the ISOs:

for filename in *.iso; do; echo extract-xiso "$filename" -d "$(basename $filename .iso)"; done

(the echo is for debugging purposes and needs to be removed; also, this might need extract-xiso -x [...], the README is a bit confusing / potentially bad)


Closed as invalid: has nothing to do with extract-xiso, but enough guidance was provided.