home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.sysv386
- Path: sparky!uunet!mcsun!Germany.EU.net!math.fu-berlin.de!umn.edu!dialup-slip-1-20.gw.umn.edu!user
- From: sells@cs.umn.edu (Chris Sells)
- Subject: Re: cpio one file at a time?
- Message-ID: <sells-300891220405@dialup-slip-1-20.gw.umn.edu>
- Followup-To: comp.unix.sysv386
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: dialup-slip-1-20.gw.umn.edu
- Organization: Spanlink Communications
- References: <sells-290891105149@dialup-slip-1-31.gw.umn.edu> <1992Aug31.011929.9632@unislc.uucp>
- Date: Mon, 31 Aug 1992 03:12:42 GMT
- Lines: 55
-
- In article <1992Aug31.011929.9632@unislc.uucp>, dold@unislc.uucp (Clarence
- Dold) wrote:
- >
- > From article <sells-290891105149@dialup-slip-1-31.gw.umn.edu>, by sells@cs.umn.edu (Chris Sells):
- >
- > > The 'mv' was only an example. I'll be performing multiple operations on
- > > each file and I need to be able to do it before the next file is loaded.
- > > BTW, what's pax?
- >
- > Methinks that a named pipe fits into this scheme somewhere.
- > I might be inclined to read directly from the tape to a file, perhaps via my
- > code, or dd, where the file on disk is a named pipe that would be a raw
- > cpio dataset. Then the "special" process would read from the raw data, and
- > pipe to cpio. While monitoring the files that cpio is creating and filling
- > (by some undescribed method), the "special" process would stop feeding data
- > down the pipe to cpio until the manipulation was done. Then the data feed
- > would resume into cpio.
- > The named pipe would be some system determined maximum size on disk, I think
- > 5K. The tape coming in would stop while the pipe was at its maximum size,
- > and feed when the named pipe is drained. The "special" process would act as
- > a throttle, controlling the data rate into cpio. Without figuring out how
- > to monitor the internals of a cpio archive, I might do something as crude as
- > a cpio -it to find the file names on disk, storing the names, then start in
- > earnest, watching for each to be created (or modified), as an indication that
- > the previous one was fully restored.
- > Named pipes are created with "mknod foobar p"
- >
- > --
- > ---
- > Clarence A Dold - dold@unislc.slc.Unisys.COM
- > ...pyramid!ctnews!tsmiti!dold
-
- You mean, something like this?
-
- mknod foo p # make input pipe
- mknod bar p # make output pipe
- pr_pid=`pipe_reader foo bar &` # start pipe_reader and keep pid
-
- dd if=/dev/rdsk/tape0 >foo & # start data dump
-
- cat bar | cpio -iv | # dump 'throttled' data into cpio
- while read file # for each file
- do
- kill $pr_pid # signal pipe_reader to pause
- handle $file # handle file while cpio paused
- kill $pr_pid # signal pipe_reader to continue
- done
-
- Thanx, I'm not sure how well this would work, but it's the best (read
- 'only) idea I've gotten so far.
- +-------------------------+
- | Chris Sells |
- | Spanlink Communications |
- | sells@cs.umn.edu |
- +-------------------------+
-