home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!news.dell.com!news
- From: painter@manufing.dell.com (Tom Painter)
- Newsgroups: comp.lang.perl
- Subject: How to wait for a pipe to complete a task?
- Message-ID: <1992Aug14.145310.29093@raid.dell.com>
- Date: 14 Aug 92 14:53:10 GMT
- Sender: news@raid.dell.com (Net News Admin)
- Organization: Dell Computer Corporation
- Lines: 31
- Nntp-Posting-Host: manufing.dell.com
-
- I need to write a program with batch FTP. I keep hitting the following
- snag. I open a pipe to 'ftp', and then I print the commands to it.
- However, the perl script will continue on once the 'print' statement is
- completed, even though the ftp has not completed it's task. It makes
- sense, but it causes a problem in this scenario:
-
- open(FTP_PUT, "ftp -n host");
- (initialize)
- .
- .
- print FTP_PUT "put $file remote_file\n";
- system(rm $file);
- .
- .
-
- Basically, the file gets removed will being "ftp'ed".
-
- Notes: I can't solve this with a simple 'sleep'. I've also handled
- buffered I/O, already.
-
- Any suggestions? (I'm going between a Unix system and a Tandem
- Guardian system.)
-
- Thanks
-
- Tom
- --
- ----------------------------------------------------------------------
- Tom Painter painter@dell.com (512) 339-5797
- Dell Computer Corp.
- Austin, TX
-