duplicate filedes for open file

Michael J. Chinni, SMCAR-CCS-E mchinni at pica.army.mil
Fri Jan 19 07:08:54 AEST 1990


Thanks to all who responded with help for my problem (get a C "FILE *ptr" for an
FORTRAN opened file).

The gist of the responces were search thru all possible fildes for the
appropriate one. While this would work, I found another solution.

I initiallly didn't want to re-open the file in the C routine (I thought that
this would cause problems). I have since tried this and found no problem. 

Therefore, that is what I have done. My C routine does the following:
	take as a parameter the filename to be opened,
	copies the name into a C string (and adds a '\0')
	opens the file
	does the read
	closes the file.

This works fine.

Thanks again.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
			    Michael J. Chinni
      Chief Scientist, Simulation Techniques and Workplace Automation Team
	 US Army Armament Research, Development, and Engineering Center
 User to skeleton sitting at cobweb   () Picatinny Arsenal, New Jersey  
    and dust covered workstation      () ARPA: mchinni at pica.army.mil
      "System been down long?"        () UUCP: ...!uunet!pica.army.mil!mchinni
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/



More information about the Comp.unix.questions mailing list