home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / perl / 5315 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.3 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!news.dell.com!news
  2. From: painter@manufing.dell.com (Tom Painter)
  3. Newsgroups: comp.lang.perl
  4. Subject: How to wait for a pipe to complete a task?
  5. Message-ID: <1992Aug14.145310.29093@raid.dell.com>
  6. Date: 14 Aug 92 14:53:10 GMT
  7. Sender: news@raid.dell.com (Net News Admin)
  8. Organization: Dell Computer Corporation
  9. Lines: 31
  10. Nntp-Posting-Host: manufing.dell.com
  11.  
  12. I need to write a program with batch FTP.  I keep hitting the following
  13. snag.  I open a pipe to 'ftp', and then I print the commands to it.
  14. However, the perl script will continue on once the 'print' statement is
  15. completed, even though the ftp has not completed it's task.  It makes
  16. sense, but it causes a problem in this scenario:
  17.  
  18. open(FTP_PUT, "ftp -n host");
  19. (initialize)
  20.     .
  21.     .
  22. print FTP_PUT "put $file remote_file\n";
  23. system(rm $file);
  24.     .
  25.     .
  26.  
  27. Basically, the file gets removed will being "ftp'ed".
  28.  
  29. Notes:  I can't solve this with a simple 'sleep'.  I've also handled
  30.         buffered I/O, already.
  31.  
  32. Any suggestions?  (I'm going between a Unix system and a Tandem
  33. Guardian system.)
  34.  
  35. Thanks
  36.  
  37. Tom
  38. --
  39. ----------------------------------------------------------------------
  40. Tom Painter                painter@dell.com             (512) 339-5797
  41. Dell Computer Corp.
  42. Austin, TX
  43.