Re: File I/O problems! Help!
- Posted by "Lucius L. Hilley III" <luciuslhilleyiii at JUNO.COM> Mar 14, 1997
- 991 views
On Fri, 14 Mar 1997 01:10:02 -0800 keiser <keiser at KEISER.EZL.COM> writes: > >Here is the program src: > 1>include get.e 2> 3>object a 4>integer b, c 5>b = 0 6>b = open("c:\\euphoria\\code\\test.dat", "r") 7>c = open("c:\\euphoria\\code\\test.txt", "w") 8> 9>a = gets(b) 10>puts(c, b) 11>close(b, c) 12>puts(1, "Done.\n") >Now, when I run it, i get this error: >read.ex:9 This tells you that the error is on line 9. As you can tell from above. That line tries to read from the file you opened for reading! >bad file number (-1) This file number is file number that was returned. If you look in the documentation you will notice that -1 means that it failed to open the file. NOW you may have a share / lock problem associated with Windows OR MOST likely you simply specified the wrong path or file name. >-->see ex.err (some other values) > read.ex: > a = <no value> > b = -1 > c = 3 As you can see here again. You were using b as the file handle for the file you were going to read in. Again the value of b is -1. This states that there was an error in opening the file. --Lucius Lamar Hilley III -- E-mail at luciuslhilleyiii at juno.com -- I support transfering of files less than 64K. -- I can Decode both UU and Base64 format.