home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10363 < prev    next >
Encoding:
Internet Message Format  |  1992-11-05  |  1.3 KB

  1. Path: sparky!uunet!sybus.sybus.com!myrddin!palan!tct!mechanic!f380.n3603.z1.FIDONET.ORG!Jeff.Tomich
  2. From: Jeff.Tomich@f380.n3603.z1.FIDONET.ORG (Jeff Tomich)
  3. Sender: ufgate@mechanic.Fidonet.org (newsout1.26)
  4. Newsgroups: comp.os.msdos.programmer
  5. Subject: FOPEN command
  6. Message-ID: <574.2AF8E8CC@mechanic.Fidonet.org>
  7. Date: Wed, 04 Nov 92 13:49:12 PDT
  8. Organization: FidoNet node 1:3603/380
  9. Lines: 28
  10.  
  11. Hello BL0528540-Bill!
  12.  
  13. 03 Nov 92, BL0528540-Bill Oswald  ALC2817 writes to All:
  14.  
  15.  
  16.  BOA>         stream=fopen("c:\foo\afile", "r")
  17.  
  18.  BOA> The resulting executable works if afile is in the same directory
  19.  BOA> as the executable. If the above is correct the fopen command
  20.  BOA> should be able to find afile independant of where the executable
  21.  BOA> lives. But that does not seem to be the case. What am I doing wrong?
  22.  BOA> BTW, I am using borland c++ 3.1
  23.  
  24. I assume *stream has been set as a pointer to point to FILE. Understanding that it is, copy the dir+filename into a variable and plug it in. Like,
  25.  
  26. char fname[80];
  27. str(fname,"c:\foo\afile");
  28. stream=fopen(fname, "r");
  29.  
  30.  
  31. Jeff
  32.  
  33. --  
  34. Internet: Jeff.Tomich@f380.n3603.z1.FIDONET.ORG
  35. UUCP:     ...!myrddin!tct!mechanic!380!Jeff.Tomich
  36. Note: Mechanic is a free gateway between USENET & FIdonet.
  37.       For information write to chief@mechanic.fidonet.org
  38.  
  39.