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