Re: file access again

new topic     » goto parent     » topic index » view thread      » older message » newer message
eukat said...


My app does

writefile = open(writefilename,"ab") -- and open a new file 

and i get a -1. The problem is that's wrong.

I can :

  • open dosbox, type D:\ngrams\dbpedia\props3\A\Autism.txt -- prints to screen
  • open dosbox, dir D:\ngrams\dbpedia\props3\A\Autism.txt -- prints data about
  • open dosbox, edit D:\ngrams\dbpedia\props3\A\Autism.txt -- opens dos editor
  • open Textpad, open and edit and save file -- performs properly

All jokes about autism and Aspergers aside, what is the malfunction here? When Eu returns -1 as writefile, there is no data to understand whatever it's problem is.

Pardon, but if I may be helpful...

said...

there is no data to understand whatever its problem is.

(Normally, I don't care since these two sound the same, but since eukat has been so helpful in pointing out these issues in the past, I thought I'd return the favor at least just this once.)

In general, it's hard to say. If open() returns -1, that just means that fopen() returned NULL instead of a valid file handle.

On a nix system, you can check libc's errno value at this point to get more useful information (e.g. was it a permissions issue, low level i/o error reported from the driver, etc.) but I don't know if the relevant analogue applies on other platforms.

At first glance, this looks like it's happening on the same disk that had the strange errors and suspected disk corruption as referenced in http://openeuphoria.org/ticket/825.wc and http://openeuphoria.org/forum/m/119991.wc

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu