•  Back 
  •  The drive U: in MagiC 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - The Operating System
Author      : 
Version     : tos.hyp (December 19, 2008)
Subject     : Programmieren/Atari
Nodes       : 3010
Index Size  : 93790
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Title
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File11.5.6.2  The directory U:\PIPE                                    TOS

In this directory pipes are stored; these are temporary files that are 
used particularly for data exchange between processes.

One differentiates between unidirectional and bidirectional pipes: the 
former allow data to flow only in one direction, the latter can 
transmit in both directions, though not simultaneously. Bidirectional 
pipes are used in the Drag&Drop protocol, for instance. Pipes return 
when reading via Fread basically EOF (End Of File) if they are empty 
or if no write process is present. Similarly, during writing with 
Fwrite the value EOF is returned if no read process is present.

The access for this is purely asynchronous, i.e. aplications wait for 
the read or write, and awake another application again if necessary. 
Pipes are deleted automatically when the last program using them has 
closed the file that represents them.

Note: MagiC supports a maximum of 32 pipes simultaneously. An Fseek on 
pipes leads basically to the return value of 0L, i.e. the file pointer 
cannot be influenced. In directories, pipes appear with a length of 2 
or 4k and the date of their creation. If an ID > 31 is returned on 
opening of a pipe, the system function Fselect cannot be used.

In addition, as of MagiC 3 the following is to be heeded:

   . Pipes with mode 4 (pseudo-TTYs) are not supported. MagiC knows 
     only uni- and bidirectional pipes and for mode 4 creates a 
     bidirectional pipe. The main reason for pipes at present is the 
     Drag&Drop protocol.

   . Pipes return for Finstat/Foutstat the number of bytes present or 
     still free in the block

   . If a pipe is closed, then all waiting programs are awakened, to 
     prevent any possible deadlocks

See also:
Fcreate   Fread   Fwrite   Fclose   Fpipe   Test for pipes