From help-octave-request at octave dot org Fri Apr 9 15:52:34 2004 Subject: Re: Can't read file with fopen and fscanf fails From: "Mariano Wis" To: "Ricardo Carvalho" , Date: Fri, 9 Apr 2004 22:47:15 +0200 Try typing the complete directory path of the file or copying oct_input.txt in the .\GNU Octave 2.1.50\octave_files\ . May be it could work better. Mariano Wis. (Barcelona, Spain) ----- Original Message ----- From: "Ricardo Carvalho" To: Sent: Friday, April 09, 2004 9:33 PM Subject: Can't read file with fopen and fscanf fails > I installed GNU OCTAVE 2.1.50 for Windows and created the directory 'D:\GNU > Octave 2.1.50\opt\octave\share\octave\2.1.50\m\harmgen\'. Then I copied 2 > files to that directory: 'harmgen.m' and 'oct_input.txt' (text file with > numbers). At the OCTAVE prompt I wrote harmgen (script presence is > recognised, no path problems) and the first line of the script was executed > but the second failed (error is 'inf= - 1'). The script file I created has > no headers (are they necessary?) and is like this: > > silent_functions = 1 > inf = fopen ("oct_input.txt", "r"); > Nc = fscanf (inf, "%u", 1) > > etc, etc, etc.... > > I then uninstalled OCTAVE for Windows and reinstalled but file presence is > still not recognised/located. In a previous instalation I was able to read > the file into memory - don't ask me why/how - but, even then, the following > instruction (Nc=fscanf...) failed. > > Please help. Thanks, Ricardo Carvalho (Lisbon, Portugal) > > > > ------------------------------------------------------------- > Octave is freely available under the terms of the GNU GPL. > > Octave's home on the web: http://www.octave.org > How to fund new projects: http://www.octave.org/funding.html > Subscription information: http://www.octave.org/archive.html > ------------------------------------------------------------- > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.655 / Virus Database: 420 - Release Date: 08.04.2004 ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------