Hi everyone.
This is my first post on this forum, so I hope I'm using it appropriately!
I've been developing a program using gfortran under Windows 10. It reads a list of files contained in another file, then opens, reads and closes each file in the list in turn. I find it's correctly reading the filenames and opening them, but I also find that it reads the first one in the list OK but after opening the next file (having closed the first one) it immediately seems to be at end-of-file and reads nothing from it. It then does exactly the same with all the other files.
Clearly, what I need is a way of ensuring that, after opening each file, it starts to be read from the beginning. Maybe it's because I use the same unit number each time, but as the list of files is of variable length, to use a fresh unit number each time could pose a different problem.
I trust I have explained that clearly enough. I would appreciate whatever help anyone could offer.
Thanks in advance.
Alan.
This is my first post on this forum, so I hope I'm using it appropriately!
I've been developing a program using gfortran under Windows 10. It reads a list of files contained in another file, then opens, reads and closes each file in the list in turn. I find it's correctly reading the filenames and opening them, but I also find that it reads the first one in the list OK but after opening the next file (having closed the first one) it immediately seems to be at end-of-file and reads nothing from it. It then does exactly the same with all the other files.
Clearly, what I need is a way of ensuring that, after opening each file, it starts to be read from the beginning. Maybe it's because I use the same unit number each time, but as the list of files is of variable length, to use a fresh unit number each time could pose a different problem.
I trust I have explained that clearly enough. I would appreciate whatever help anyone could offer.
Thanks in advance.
Alan.