Exit with error codes

Have an idea how to make KryoFlux even better? Let us know...
Post Reply
tomse
Posts: 16
Joined: Thu May 23, 2013 10:57 am

Exit with error codes

Post by tomse » Sat Jul 27, 2013 4:03 pm

I'd like to have an exit of DTC with an error code set to systems errorlevel when a dump is finished.

i.e. if track 40 of an Amiga diskette is bad and the rest good, it should fail, when dumping i.e. ADF files.
otherwise it should exit with error code 0 (success)

at the moment it doesn't give an error at all.

i.e. on windows you can set errorlevel to 1, which is still set after a dump is complete

User avatar
mr.vince
Posts: 1871
Joined: Tue Oct 05, 2010 5:48 pm

Re: Exit with error codes

Post by mr.vince » Sat Jul 27, 2013 6:00 pm

Output is much more diverse, you can parse error out if you like.

tomse
Posts: 16
Joined: Thu May 23, 2013 10:57 am

Re: Exit with error codes

Post by tomse » Sun Jul 28, 2013 7:43 am

I prefer to keep things simple.

and if I start a disk dump, I just want to know if the dump was done successfully or if the disk has errors.
it'll be quite useful for batch/shell scripting.

User avatar
mr.vince
Posts: 1871
Joined: Tue Oct 05, 2010 5:48 pm

Re: Exit with error codes

Post by mr.vince » Sun Jul 28, 2013 1:29 pm

But what's an error? Copy protection (recording scheme violation)? Modification (from the view of a preservationist)? What do we do about weak bits?

There's no black and white here...

User avatar
Malvineous
Posts: 156
Joined: Sun Oct 31, 2010 10:57 pm
Location: Brisbane, Australia
Contact:

Re: Exit with error codes

Post by Malvineous » Mon Jul 29, 2013 10:15 am

If you want to keep it extra simple you could use a utility like grep to search for certain strings in DTC's output, then use grep's exit code to figure out whether there was a match or not and base your logic on that.

tomse
Posts: 16
Joined: Thu May 23, 2013 10:57 am

Re: Exit with error codes

Post by tomse » Fri Sep 06, 2013 10:47 am

there are alot of options.. I could also use python or some other parser apps, but then I'd have to use external apps which isn't "keep it simple" anymore
using grep isn't keep it simple either.

and the graphical interface cannot handle some files so I need to use command prompt.

mr.vince wrote:But what's an error? Copy protection (recording scheme violation)? Modification (from the view of a preservationist)? What do we do about weak bits?

There's no black and white here...
well this isn't primarily for the view of preservation, for the stream process it can just be disabled, when you dump to an image file it is useful

if you're dumping a dos diskette there is (atleast for most parts) tbh I've never seen a dos diskette that was protected on the diskette level like c64/amiga.
but it's still something where you can identify an area to pay attention to.
if you know for a fact that the diskette doesn't have protection, and it gives an error.. I'd still like to know it. as there'd be no reason to keep the image file it it contains errors.

User avatar
IFW
Posts: 2634
Joined: Mon Nov 08, 2010 2:42 pm

Re: Exit with error codes

Post by IFW » Fri Sep 06, 2013 12:17 pm

Quite a lot of disks contain protection, even for PC dos.

tomse
Posts: 16
Joined: Thu May 23, 2013 10:57 am

Re: Exit with error codes

Post by tomse » Fri Sep 06, 2013 12:29 pm

so I take it that it's a feature request that won't be implemented?

User avatar
mr.vince
Posts: 1871
Joined: Tue Oct 05, 2010 5:48 pm

Re: Exit with error codes

Post by mr.vince » Fri Sep 06, 2013 7:03 pm

The question is: which error code should we use for what? To which image type would it apply when dumping multiple?

That's why we initially decided against an error code but to go for parsing.

We try to make decisions that make sense, it's not to annoy you or turn you down.

tomse
Posts: 16
Joined: Thu May 23, 2013 10:57 am

Re: Exit with error codes

Post by tomse » Fri Sep 06, 2013 8:59 pm

well for streaming... is there a need for error codes as it's impossible to see if there is an error.
lets take protected amiga disks they end out in a size 0 when it's protected. meaning there is an error somehow.
any other "native" imaging i.e. adf, g64, st, img etc should end out with errorcode 0 (success) when a true none errored file is dumped.

if an error occurs it could be a 1 (error/failed) or it can be more detailed with more error codes.. the most important part is just.. dumping to a native image file is it successful or not.

when you dump to multiple formats.. the error should take precedence as to notify the user of the error code so he/she can take action/investigate.

the errorcodes are the ones exited to the OS that can be picked up by windows %errorlevel% and *nix $? .. I don't know what it is for mac, but might be the same as *nix

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest