1. More Info about my problem

--HELLO READ THIS STRING !!!
include doswrap.e
--
atom addr, handle, NbRead
-- Open Testme.ex file for binary read
  handle = DosOpen("testme.ex",READ)
  if handle = -1 then
    puts(1,"\nCould not open testme.ex \n")
  end if
--
addr = allocate_low(28)
NbRead = BlockRead(handle, addr, 28)
printf(1,"\n addr = %x  Number of bytes read = %d\n",{addr,NbRead})
-- Now what's in the buffer
printf(1,"\n  %x  %s  %x  %s",{addr,peek(addr),addr+1,peek(addr+1)})
------------------------------------------------------------------------

  If I run The above program. Which is called testme.ex

  Yes I am reading the first line in the same file but you can use any file.

  I get the following results:

  addr = 11550  Number of bytes read = 1

  11550  t  11551  e
---------------------------------------------------------------------
  Notice that the number of bytes returned by blockread is ONLY 1.

  and if I read the first two characters addr I get the first 2

  characters of the filename.

Robert can you tell me why blockread is failing.
I am using WIN95 SR2 but I rebooted into DOS ( F8 )command prompt only mode

new topic     » topic index » view message » categorize

2. Re: More Info about my problem

Bernie Ryan writes:
>  I get the following results:
>
>  addr = 11550  Number of bytes read = 1
>
>  11550  t  11551  e
> ---------------------------------------------------------------------
>  Notice that the number of bytes returned by blockread is ONLY 1.

I ran your testme.ex in a Win95 DOS window and it ran
perfectly. When I restarted in plain DOS mode, it gave:

     "Could not open testme.ex"

number of bytes read = -1
and also "t" and "e" as you saw.

Note that the bytes read was -1 (minus one) *not* 1.
That means it failed to open the file.

I don't know why the program failed under plain DOS,
but Jacques' code seems to use a different DOS interrupt
depending on the version of DOS that it thinks it is running on.

I'm pretty sure that people have run Jacques code on plain DOS
before without a problem, e.g. games, sound blaster etc.

I guess you'll have to consult with Jacques, or someone who
knows about DOS interrupts. Maybe he's trying to use a
long filename interrupt for opening a file, when plain DOS
on Win95 doesn't support long filenames.

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu