
The Art of Scintography Edition 3.0 © 2008 Aurora Isaac www.scintography.com | |||||||||||||||||||||||||||||||||
IV.1 File Systems | |||||||||||||||||||||||||||||||||
|
In the early days of computers, the idea of a file came before the idea of a directory.
A file is a sequence of data identified by name.
The first computers had what is now called a flat file system.
In essence, a single directory contained all the files on the system.
As computers evolved, it quickly became apparent that this system was cumbersome to organize and maintain.
The idea of a directory soon followed.
A directory is a special type of file, containing a list of filenames. The operating system uses directories to interface between the hardware, where the data is stored, and the software, through which you access the data. Although a file is presented as a continuous sequence of data bytes, this sequence may be stored on the hardware in fragments that are collected and reassembled by the operating system when the file is accessed. In addition to the file name, a directory contains an identifying code used by the operating system to access the stored data. Most operating systems now use the tree file system, in which directories may contain the names of other directories, as well as files. | |||||||||||||||||||||||||||||||||
IV.2 Absolute and Relative Path | |||||||||||||||||||||||||||||||||
|
A directory tree expands from the root.
The root is the top level directory of a system.
It is usually represented by a forward-slash (/) or a backward-slash (\), depending on the operating system.
A filename is actually a path from one place in the directory tree to another.
The slash is also used to separate directory levels in a path.
The sample file system below contains files and directories. In a complex system, the root directory generally contains files related to system operation. In this example, the root directory also contains the bin and user directories. By convention, a bin directory holds executable binary files. Depending on your operating system, you should be able to access the executable files within a recognized bin directory by their simple filenames, without referring to the directory path. On a system that supports multiple users, each user is assigned separate directory space. In this example, two users are assigned space within the user directory. The user1 and user2 directories each contain some files that are in a directory accessible from the internet, and other files that are accessible only by interfacing directly with the operating system, generally by logging in with a username and password.
An operating system, such as Unix, Linux, Windows, etc, recognizes files by their absolute or relative names. The absolute name of a file includes all directories on the path from the root directory to the file. For example, the absolute filename of the file manual.txt in user2's domain is:
where the first slash is the root directory, and the following slashes separate directory levels.
In addition to the special directory name slash (/), used for the root directory,
the special name dot ( . ) is used to denote the current directory,
and the special name dot-dot ( .. ) denotes the parent directory.
The parent directory is the directory that contains the current directory.
In the example above, the directory user is the parent of the directory user2.
where the first .. is the path from directory user1stuff to its parent, user1,
and the second .. is the path from user1 to its parent, user.
From this directory the path turns into the user2 "branch" to user2stuff which contains the target file.
| |||||||||||||||||||||||||||||||||
IV.3 Absolute and Relative URL | |||||||||||||||||||||||||||||||||
|
Files accessed from the World Wide Web may also be referenced by their absolute or relative names.
A www filename is a URL.
On the web, the domain name of a site accesses the root of a directory tree that constitutes the domain of that site.
This site root rarely coincides with the system root (/).
A single computer may have many domains assigned to directory trees within its file system.
The example above includes two domains assigned to the directories user1site and user2site.
Mouseover these files to see the files included in the domains of each site.
Unless it is otherwise protected, any file within a site domain can be accessed by its absolute URL. For example, as you mouseover the user1 site in the above example, you will see that the file gp.jpg can be accessed by its absolute URL as:
From within a file accessed on the web, the current directory is the directory that contains the file. For example, the file www.domain1.com/index.htm may form a link to gp.jpg with the absolute URL above, or with its relative URL, as follows:
Relative filenames and relative URLs are the same. Explore the Example File System below for more samples of absolute and relative URLs. | |||||||||||||||||||||||||||||||||
IV.4 Example File System | |||||||||||||||||||||||||||||||||
|
The example file system below includes directories, text files, and image files.
Use this system to explore variations in referencing files.
Click on the top level to toggle between the URL and system roots, then mouseover another file or directory to see its absolute path. Click on a filename to select, then mouseover another file or directory to see its path relative to the current directory, which contains the selected file. Click on the filename again to deselect. When you mouseover a file, the path to that file will appear under the title above the filesystem, and in the title/tip that appears as you hold the cursor over the filename.
Absolute URL
| |||||||||||||||||||||||||||||||||
IV.5 File Names and File Handling | |||||||||||||||||||||||||||||||||
|
The simple filename, not including the path, includes the file name and type.
The name, or prefix, and type, or suffix are separated by a period (.).
For example, in the filename myfile.txt, "myfile" is the prefix and "txt" is the suffix.
Operating systems follow a variety of rules on how filenames may be written.
On some systems, the number of characters in the prefix and/or suffix is limited. If you discover that a filename has been truncated, you will know you have reached this limit. Newer systems allow very long names. The types of characters that may be used in a filename varies from system to system. Spaces may or may not be allowed. Characters such as *, !, @, etc. should be avoided even if they are allowed. Some systems acknowledge upper and lower case in filenames, others do not. This can be especially frustrating when you move a file from a system that is case insensitive to a system that is case sensitive. A link to file "pic.gif" may no longer work if the file is named "pic.GIF". If you plan to move files from one system to another, as you do when you publish a site, keep your filenames simple. Use only alphanumeric characters (letters and numbers), with underscore (_) or hyphen (-) instead of spaces. For the most part, the prefix of a filename may be any name you choose for your application. The suffix, on the other hand, may be restricted. By convention, the suffix was used to denote the file type. Now this convention has become a part of software design. Operating systems may assign handlers to files, based on the suffix of the filename. A handler is an application that is activated when a non-executable file is activated. For example, if you click on a JPG image file in a directory listing, the handler assigned to the JPG file type will be activated, displaying the image file. Suffix names are often only three characters long because some operating systems only allow three characters. Adhering to this limitation allows files to be transferred from one system to another and still be recognized. This is especially important on the internet, where files of many types must be handled by the browser. | |||||||||||||||||||||||||||||||||
IV.6 File Access | |||||||||||||||||||||||||||||||||
|
A variety of applications have been developed to interface with the operating system in determining who may access a file.
Underlying all these applications, the most basic protection available, is the design of the file system itself.
Many operating systems use a file access mode based on the UNIX model. In this system, permissions to read (r), write (w), or execute (x) a file can be individually set. These permissions can be designated for the owner of the file, the group the owner belongs to, or all others. The owner (user) name and group name are assigned by the system operator. These allow users to keep some files private, share some only with a work group, and make others publicly available. The access mode of a file is often expressed numerically, giving one binary bit (digit) to each permission. The resulting string of nine digits is often expressed as an octal integer.
Generally, access from the internet requires "all others" have read access to a file, and read-execute access to a directory. Typical modes are 644 or 664 for publicly accessible files, and 755 or 775 for directories. | |||||||||||||||||||||||||||||||||
| All Contents © 2008 Aurora Isaac. All Rights Reserved. Legal Notices. | |||||||||||||||||||||||||||||||||