next up previous index
Next: GNO/ME Character Devices Up: Chapter 3: Modifications to Previous: Quitting Applications   Index

Refnums and File Descriptors

GS/OS tells you about open files in the form of refNums (reference numbers). UNIX's term for the same concept is ``file descriptor''. From a user's or programmer's view of GNO/ME, these terms are identical and will be used as such; which one depends on what seems most appropriate in context.

For each process, GNO/ME keeps track of which files that particular process has opened. No other process can directly access a file that another process opened (unless programmed explicitly), because it doesn't have access to any file descriptors other than its own. This is different from GS/OS in that GS/OS allows access to a file even if a program guessed the refNum, either deliberately or accidentally. This is one of the aspects of process protection in GNO/ME.

All of the various I/O mechanisms that GNO/ME supports (files, pipes, and TTYs) are handled with the same GS/OS calls you are familiar with. When you create a pipe, for example, you are returned file descriptors which, because of synonymity with refNums, you can use in GS/OS calls. Not all GS/OS calls that deal with files are applicable to a particular file descriptor; these are detailed in the sections on pipes and TTYs.

GNO/ME sets no limit on the number of files a process may have open at one time. (Most UNIX's have a set limit at 32).


next up previous index
Next: GNO/ME Character Devices Up: Chapter 3: Modifications to Previous: Quitting Applications   Index
Feedback