1. RE: Previous Message All Messages Next Message Re: Checking file integrity
- Posted by rforno at tutopia.com Apr 23, 2003
- 394 views
excess line excess line excess line Bernie: Of course I know that Euphoria is a programming language, and the one I like most. But I'm not asking that Euphoria performs data *recovery*. I only am wondering if Euphoria can tell us about any data *error* that the OS or the hardware driver detects. Is C a programming language? Is Assembly Language a programming language? Maybe C cannot tell us about input data errors (I still don't know), but Assembly surely does. If not, how can we know there *was* an error? DOS knows if a diskette file has errors (have you ever seen the message "Abort, Retry, ..."?). Windows also does. And of course, this can also happen with CDs, as I had recently experienced. So, as Euphoria is mainly written in C with some Assembly, the question is: can it pass to the user the error that C or Assembly detected, or is this information unavailable? Regards. ----- Original Message ----- From: Bernie Ryan <xotron at bluefrognet.net> To: EUforum <EUforum at topica.com> Sent: Tuesday, April 22, 2003 11:04 AM Subject: Previous Message All Messages Next Message Re: Checking file integrity > Euphoria is a programming langauge. > What you are are asking for is a way to to do data recovery. > Data recovery is not a function of a programming langauge but > has to be written by a programmer using a programming langauge > to do the data recovery, so that is not Euphoria's responsibility. > > > > TOPICA - Start your own email discussion group. FREE! > >
2. RE: Previous Message All Messages Next Message Re: Checking file integrity
- Posted by jbrown105 at speedymail.org Apr 23, 2003
- 413 views
On Tue, 22 Apr 2003 14:24:24 -0300, rforno at tutopia.com wrote: > Bernie: > Of course I know that Euphoria is a programming language, and the one I like > most. > But I'm not asking that Euphoria performs data *recovery*. I only am > wondering if Euphoria can tell us about any data *error* that the OS or the > hardware driver detects. > Is C a programming language? Is Assembly Language a programming language? > Maybe C cannot tell us about input data errors (I still don't know), but > Assembly surely does. If not, how can we know there *was* an error? DOS > knows if a diskette file has errors (have you ever seen the message "Abort, > Retry, ..."?). Windows also does. And of course, this can also happen with > CDs, as I had recently experienced. > So, as Euphoria is mainly written in C with some Assembly, the question is: > can it pass to the user the error that C or Assembly detected, or is this > information unavailable? > Regards. If you use the Euphoria builtins, maybe, but it may prove tricky, as its possible that the interpreter might clear errno or something. However, you could always use define_c_func()/proc() in Windows/Linux, to access the standard C file access functions directly, and define_c_var(), to access errno directly. (At this point I should point out, under Linux/BSD C does return input data errors, tho some of them, such as EIO, can be vague, I dont know about Windows but I suspect it would be the same, since DOS did.) Under DOS, you'd need to do a bit more work tho ... either write up a machine code routine to call the interrupt you want (i.e. use ASM), or use the translator and link to a C library which provides the file functions you want. In short, it is possible, but its not easy, as you have to access the file on a lower level. You can also take a look at the cross-platform file library that Juergen and I are working on, for some hints. (The lib implements stuff like delete() and rename() and move() and copy() and etc tho, it does not replace gets() or puts() or other routines provided by Euphoria builtins/standard libraries tho. The only exception to this, that I currently remember, is open() - on DOS32, the lib provides for long file names, and xdir() - long file names on DOS32 access to linux attributes under Linux (tho this is somewhat shoddy), dont remember what it does for Windows.) jbrown > ----- Original Message ----- > From: Bernie Ryan <xotron at bluefrognet.net> > To: EUforum <EUforum at topica.com> > Sent: Tuesday, April 22, 2003 11:04 AM > Subject: Previous Message All Messages Next Message Re: Checking file > integrity > > > > Euphoria is a programming langauge. > > What you are are asking for is a way to to do data recovery. > > Data recovery is not a function of a programming langauge but > > has to be written by a programmer using a programming langauge > > to do the data recovery, so that is not Euphoria's responsibility. > > > > > > TOPICA - Start your own email discussion group. FREE! > > -- http://www.fastmail.fm - Or how I learned to stop worrying and love email again
3. RE: Previous Message All Messages Next Message Re: Checking file integrity
- Posted by rforno at tutopia.com Apr 24, 2003
- 400 views
Pete: The CD I was speaking of is not protected, as far as I know. Once upon a time it was completely readable, but later on it developed a scratch. As a matter of fact, I have good copies of it. My aim was to develop a program that detects unreadable files in a medium, like hard disks, CD-ROMs, diskettes or whatever. Believe it or not, at this very moment I have no bad diskettes at hand, so I can't test it. But I hope to have one soon... Regards. ----- Original Message ----- From: Pete Lomax <petelomax at blueyonder.co.uk> Subject: Re: Previous Message All Messages Next Message Re: Checking file integrity > a > a > a > a > a > a > a > a > a > a > a > > > On Tue, 22 Apr 2003 14:24:24 -0300, rforno at tutopia.com wrote: > > > > >Bernie: > >But I'm not asking that Euphoria performs data *recovery*. I only am > >wondering if Euphoria can tell us about any data *error* that the OS or the > >hardware driver detects. > I did a quick search on nero read error and found: > that nero is validating the checksums and deliberately refusing to > continue if it suspects copy protection is in use, almost certainly > for legal reasons. > "Neros complex read error handling", (in the advert blurb) > "Not all drives are capable of returning error information" > which suggests that nero specifically has code to get additional error > info from more modern drives in a way DOS etc would not. > "Now go to the Copy Options tab. > ...Click Read Options. > ...Number of Retries before error: " > > Anyway, have a look at this: > http://www.phoenix.com/resources/specs-cdrom.pdf > It may not be what you expect, but it shows how int 13 is used to make > the cd drive emulate a normal drive, presumably if you use an int 13 > call to switch this off it would be possible to read the actual disk > image where there may be some hidden checksums. I suspect > there may be a few dog-eared copies of that at the nero offices. > > One trick we employed back in the days when distributing software on > diskette was to make a bad block in a temporary file, fill the rest of > the disk and then delete the temporary file. All the visible files > would verify just fine, but copying the disk gave a read error. > I hadn't made that connection before, but it is reasonable to assume a > similar scheme could be used on cds. I know the penny will have > dropped by now but I'll say it anyway: your program may not even be > reading the part of the cd where the error lies. > > Pete > > > > TOPICA - Start your own email discussion group. FREE! > >