home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / programm / 6060 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.4 KB  |  36 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!ftpbox!news.acns.nwu.edu!nucsrl!ddsw1!shibumi
  3. From: shibumi@ddsw1.mcs.com (Michael Karrys)
  4. Subject: Need help with system() function call
  5. Message-ID: <C1Iwvx.7Ir@ddsw1.mcs.com>
  6. Date: Wed, 27 Jan 1993 17:35:56 GMT
  7. Organization: ddsw1.MCS.COM Contributor, Chicago, IL
  8. X-Newsreader: Tin 1.1 PL3
  9. Lines: 25
  10.  
  11. I am trying to use the system() function call to send a print job into
  12. the background from a foreground running program.  The problem I am running
  13. into is that any foreground open files cause the background program to
  14. stop and hang. The strange thing is that the background program runs fine
  15. as a foreground program and when run as a background program its file
  16. references are zero ( prior to opening were in it just hangs ).
  17.  
  18. If I close the files in the foreground process prior to starting the
  19. background process everything works fine, however, this will
  20. cause a great deal of complexity in my programming. I have also tried 
  21. unlocking tables and indexs in the foreground and background processes
  22. without any success.
  23.  
  24. What I wanted was the background process to be completely separate program
  25. and not associate the file descriptors from the foreground. I want to send
  26. a string similar to this.
  27.  
  28. system("backprog -p -w >/dev/null 2>&1 &");
  29.  
  30. I would appreciate it if somebody could shed alittle light on this for me.
  31.  
  32. thanks Mike Karrys
  33.  
  34. P.S. I am using Codebase 4.2 C Library.
  35.  
  36.