COHERENT manpages

This page displays the COHERENT manpage for file [The way to access bits].

List of available manpages
Index


file -- Definition

The way to access bits

The term file is used throughout the world of computing.  Because there are
several distinct  types of COHERENT ``files,''  understanding what COHERENT
means by a ``file'' can help you grasp how COHERENT works.

A  file is  a mass  of bits  that is  given a  name and  is stored  on some
physical medium (e.g., floppy disk, hard disk, RAM disk, or CD-ROM).  These
bits  may represent  data (e.g.,  ASCII or  EBCDIC characters)  or machine-
executable instructions.   COHERENT defines a number  of different types of
files.  A file's type defines its behavior.  Some common file types include
the following:

regular
     This  file points  to  a location  on  a disk,  which can  be read  or
     written.  The  location pointed  to can  contain data (e.g.,  text) or
     executable  instructions  in  the form  of  shell  commands or  binary
     instructions.  Regular files are sometimes called ordinary files.

directory
     A directory  holds the names  and addresses of  other files, including
     other directories.

special
     Special files  designate COHERENT devices.   A device can  represent a
     physical device,  such as a  floppy disk drive,  a printer port,  or a
     serial port.  It can also represent  a part of a physical device, such
     as a RAM disk (representing part of memory) or one partition of a hard
     disk.  It  can also  represent a logical  device that has  no physical
     counterpart, like the bit bucket /dev/null.

     Special  files  come  in  two  flavors:  character special  and  block
     special.  The former access data in streams (that is, one character at
     a time), and so access devices like tape drives and serial ports.  The
     latter access one block at a time, and so access disk drives and other
     devices  that  return their  data  in  block-sized chunks.   (COHERENT
     defines a block as being 512 characters.)

FIFO This  is a  variety of  regular file that  contains semantics  to hook
     together two  processes, just like  a pipe `|' in  the COHERENT shell.
     See  the Lexicon  article named  pipe for details  on this  variety of
     file.

process
     This  kind of  file  corresponds one-to-one  with the  existence of  a
     process on a system.  It tends to be short-lived.

Files live  with a  file system,  which organizes the  files hierarchically
within  directories.  The  Lexicon entry  for the  command mkfs  gives some
technical information  on how  a file  system is constructed.   The Lexicon
entry for  the command mount  gives some information  on how a  file system
relates to  device on which it  lives, and how different  file systems from
different partitions are hooked together  to form one large file system for
the entire computer.

The  same file  can have  (and  be accessed  by) more  than one  name.  The
Lexicon entry for the command ln shows how you can link additional names to
a file.  The  entry for the system call unlink()  gives some details on the
relationship between a file and its names.

Finally, a file has permissions associated with it.  Every file is owned by
someone; and the owner can restrict  access to the file if she wishes.  The
Lexicon entry  for the command ls describes  what permissions are available
for  a file.   The entry  for the  command chmod shows  how you  can change
permissions on a  file.  The entry for the command  umask shows how you can
change the permissions that COHERENT gives by default to any files that you
create.

See Also

chgrp,
chmod,
chown,
directory,
FILE,
device drivers,
ls,
mkfs,
named pipe,
open(),
Programming COHERENT,
stream,
umask,
Using COHERENT
ANSI Standard §4.9.3