KB Logo

TOLIS Group Knowledge Base

Browse KB by category:
Go to KB #:
Email   Bookmark

OS X Standard I/O Streams

Views: 16466
Votes: 2
Posted: 15 Oct, 2007

OS X Standard IO Streams – a One Page Primer

Under Mac OS X , reading or writing data on a tape requires either a ‘tape aware’ application such as TOLIS Group’s BRU , or a utility that can read the raw data off of the tape and provide it to the appropriate application or take the output of the application and send it to the tape drive. These applications, such as tar, cpio, or pax provided in OS X are not tape aware. The TOLIS Tape Tools’ taperead and tapewrite utilities are such tools.

The taperead (and tapewrite) utilities make use of the Unix standard streams – standard in (stdin) and standard out (stdout) – to allow access to tape media by normal tools such as tar and cpio. The mechanism that is used is called a command pipeline. This mechanism allows the output of one tool to provide the input to the next tool in the pipeline. For example, if you wanted to examine the contents of a file containing the names and email addresses of your friends called myfriends.txt, but only display the last names in A-Z sorted order, you could use:

cat myfriends.txt | awk ‘{ print $2 }’ | sort

There are actually 3 commands issued in that single line: cat, awk, and sort. The output of cat, which would normally be displayed on your screen, becomes the input for the awk command. The awk command then pulls out the second field and sends it out to become the input of the sort command. The sort command then sorts the list of last names provided by the awk command’s output and displays them in alphabetical order on your screen.

The taperead and tapewrite utilities use this same method of providing input to or taking output from the various archive utilities. This enables you to either read or write tapes using OS X tools that do not normally have the ability to access tape drives.

Others in this Category
document How do I control my tape library with the libctl (tm) command on Mac OS X?
document How do I write to a tape with the 'tapewrite' command?
document How can I test to see if my tape drive/library is operating properly under Mac OS X?
document How do I control tape devices with tapectl(tm)?
document Apple SIP prevents access to special folders causing "Permission denied" errors
» More Articles

Powered by KnowledgebasePublisher
Page Load Time: 0.027525 seconds / 27.525 milliseconds.
Page File Size: 22288 bytes.