Previous Next Chapter

Using PIPE:

The PIPE: device transfers data from one program to another using temporary storage in RAM. Use a pipe: when you wish to apply output from one process as input to another process. Using a pipe to transfer data reduces the possibility of running out of memory when working with very large files and eliminates the need to create, save, and later delete a file needed only once.

The yource and destination processes cannot be the same when using PIPE:. As you write information to the pipe, another process can read the data in First In First Out (FIFO) order. Providing a name after PIPE: gives the pipe a name.

Data sent to PIPE: is buffered in memory. When another application reds the pipe it gets the data in the order it came in. The pipe stays in RAM until its contents are emptied by the reading processes or until the next reboot.

PIPE: uses at least a 4 KB buffer per pipe-name. When the maximum buffer capacity is reached, PIPE: stops accepting data until another process reads data out of the buffer. If a process is reading data, it waits until more data arrives in the buffer. Buffer size can only be specified on the first reference to a particular channel.

The following are the options for PIPE:PIPE:options.

channel_name

A unique channel name. Must begin with a non-numeric character. The channel_name is optional; using PIPE: alone is possible if not using multiple pipes.

Buf_size

Size in bytes of the buffer to allocate. (The default size is 4 KB). The buf_size is optional.

max_buffers

Maximum number of buffers allowed. Suspends the output channel if exceeded. Max_buffers = 0 indicates there should be no fixed limit on the number of buffers allocated.

PIPE: can be used from other programs, such as word processors or terminal programs. You can use any pipe-name. If the application reads the file sequentially, you can specify PIPE:<name> and it appears the same as an ordinary file to the application.

Information from one pipe can be copied to another. For example:

Shell window 1:

COPY Hugefile PIPE:a

Shell window 2:

COPY PIPE:a PIPE:b

Shell window 3:

COPY PIPE:b PIPE:c

Shell window 4:

COPY PIPE:b PIPE:d

Shell window 5:

COPY PIPE:d PIPE:e

Shel lwindow 6:

TYPE PIPE:e ;Hugefile is TYPEd

The DOSDrivers mount file for PIPE: mount files:for PIPE:is as follows:

Handler = L:Queue Handler
Priority = 5
StackSize = 3000
GlobVec = -1

PIPE: is mounted by default during the standard Startup-sequence.

See Chapter 8 for additional PIPE: examples.

Top Previous Next Chapter