Re: opening existing files with OPEN()
- From: *** Hendrickson <***.hendrickson@xxxxxxx>
- Date: Wed, 12 Sep 2007 15:37:29 GMT
maserda@xxxxxxxxx wrote:
Sorry for the delay, but I was unfamiliar on how this thing notifiedHow do you know you type it correctly? Some things to try.
the creator of any replies.
The file I am asking for it to find is a copy of a small portion of a
very large raw data file (just for me to make sure the program works
before I try running it on the real thing). The data in the file is
in the following format:
234843.23,4782438.85,239.42
458394.34,2204845.34,247.60
...
(just an example of the numerical values, but the format/style is the
same)
(and yes, there aren't any spaces in any of the lines)
So one of the issues I was trying to solve before my posted problem
was getting the program to read this format correctly.
The thing is, the program was finding this particular file fine until
it just randomly stopped finding it (I was getting error number 29 for
my openstatus value when I was using the in-program debug program
which told me all of the values of my given variables, which I have
interpreted to being the error #, not the # of errors). I am fairly
confident that I have the correct directory: when I run it in DOS/
Command Prompt, I see both the executable AND the input file when I do
the 'dir' command (using Windows). And I do type in the input file
correctly when it asks me.
1) WRITE out the file name after you've typed it in. Something like
write (*,'(a3,a,a3)') ">>>",filename,"<<<"
the > and <s are to make sure you see where the filename begins
and ends, it's sometimes hard to see leading blanks.
1.5) Have you got the case of the file name correct? Do you have the
proper name extension? Are you using "name" when you need "name.txt"?
Some directory listing utilities don't always show the extension.
2) Put the file name in quotes in the OPEN statement, not a variable.
That way you are sure of what you are trying to open. Once you make
that work, go back to typing in the name.
3) Most compilers support some sort of way to run a shell command.
Try something like
call system ("dir")
as a first step in your program. This should give you the contents
of what the OS thinks is the directory.
4) Try an INQUIRE with an iostat parameter. You said in other posts
that you've tried INQUIRE, but I'm not sure what specifiers you
used. At least try the exist= specifier and print the results.
5) Have you checked the file permissions? If you don't have the right
kind of access permission, the OS might not let you "see" the file.
*** Hendrickson
The error I am getting while running the debugger in my developer.
studio is the following:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\SYSTEM32\kernel32.dll', no matching symbolic
information found.
The program 'C:\Documents and Settings\Mary Serdakowski\Desktop
\Shoreline_Extract\Debug\Shoreline_Extract.exe' has exited with code 0
(0x0).
Hope this helps...
Also, this is my first work in coding/programming in over four years
and I'm learning Fortran in the process, so pardon my stupid
questions.
To specific people:
- Steven Kargl, I do not fully understand. How do they not match?
- *** Henderson, I've never heard of the INQUIRE command. What is
the proper layout for that command?
- Follow-Ups:
- Re: opening existing files with OPEN()
- From: maserda@xxxxxxxxx
- Re: opening existing files with OPEN()
- References:
- opening existing files with OPEN()
- From: maserda
- Re: opening existing files with OPEN()
- From: maserda
- opening existing files with OPEN()
- Prev by Date: Re: a question regarding printing out format
- Next by Date: Re: a question regarding printing out format
- Previous by thread: Re: opening existing files with OPEN()
- Next by thread: Re: opening existing files with OPEN()
- Index(es):