Cad Guidebook: A Basic Manual for Understanding and Improving Computer-Aided Design (16 page)

Read Cad Guidebook: A Basic Manual for Understanding and Improving Computer-Aided Design Online

Authors: Stephen J. Schoonmaker

Tags: #Science & Math, #Biological Sciences, #Biotechnology, #Professional & Technical, #Medical eBooks, #Special Topics, #Professional Science

BOOK: Cad Guidebook: A Basic Manual for Understanding and Improving Computer-Aided Design
9.57Mb size Format: txt, pdf, ePub

As mentioned in Chapter 2 on computer hardware, computer files are the
basic vehicle for holding data on a computer for “permanent” storage. The files
are kept in what can be called the storage system, but for most computer systems
the storage system is going to be a disk drive device. So, the operating system is
generally going to keep track of all the data on a disk drive or a set of disk drives.

One of the most obvious characteristics of file management is going to be
how the disk drives are designated. On some operating systems (such as Win-
dows), the drives are given letter designations (e.g. A or C). In this case, the A
drive is going to be a diskette device that can be used to transfer files between
computers. The A drive may also be referred to as a “floppy drive,” but the dis-
kette case has not been floppy for quite some time. To refer to a specific file on
this type of operating system, then, it can begin with the letter designation for the
disk drive as shown by the following:

Computer Software Basics 55

A:\USER\GUY\FLOPPY.DAT

Note that the full designation for the device is followed by a colon “:”. This
format was also typical on the VAX/VMS operating system. On this system, the
following might be typical:

USER1:[USER.GUY]FLOPPY.DAT;1

Note that in both these examples, the disk drive designation (A: or DISK1:)
is followed by two directory designations. Directories or folders are a very essen-
tial element of the operating system. They allow a great number of files on a par-
ticular disk drive or file system to be well organized. In the first example (PC-
DOS), the “backslash” or “\” is used to delineate the directories. In the second
example (VAX/VMS), the square brackets and a dot are used to show the direc-
tory names.

3.2.7.1 Directories or Folders

Directories can be seen as a tree structure (refer to Figure 3.2). At the top there is
a first level or “tier” of directories that form the most basic division of the filing
structure on the disk drive or file system. Some of the directories of this first level
would typically be used to segregate files that are part of the operating system
software from files that are subsequently loaded to the computer as applications.
The applications may then be further segregated as those loaded for all users ver-
sus those loaded for specific users. Then, there may be directories at the first level

FIGURE
3.2

Typical directory and Subdirectory structures.

56 Chapter 3

that are for various users to use as they see fit. This would be more typical for
multi-user systems that are being shared. In most cases, though, individual users
have their own computer, so most likely there would only need to be one level of
segregation between a single user and the operating system (i.e. the Windows di-
rectory containing all the operating system files).

At the next level of segregation, a specific application (such as the CAD
software) may utilize its own scheme for organizing files. Typically, there would
be a level of directories for such things as the executable or binaries that actually
run on the computer, the sample cases, the help files, and customization or con-
figuration files. Exactly how the disk drive or drives are broken into a system of
directories is a pretty involved process; a full description can not be given here.

There is no real difference between these directories and folders in the
graphical user interface (GUI) based systems (such as File Manager, Windows
Explorer, File Tools, etc.). Most users are going to be able to work with the fold-
ers exclusively, but users should be aware that the more fundamental topic is con-
sidered to be directories, and many IT professionals will continue to refer to them
as directories and subdirectories.

Note that on the unix-type operating systems, directories become an even
more important issue. On these systems, there is no designation for a disk drive
device (like A: or C: or USER1:). Instead, the entire operating system and all the
applications are melted into a single directory structure. At the top of this direc-
tory is the root file system. All files (regardless of what disk drive they are on) are
then given a consistent name within the overall structure. If there are different
disk drives, then they are given a specific location in the directory structure called
a “mount point.” For instance, the following may be a directory name in the oper-
ating system’s structure (note that unix-type systems use a forward slash or “/”
for the directory delineation):

/usr/local

A unix operating system may actually be configured so that any reference
or use of any file that starts with this set of directories actually means use a spe-
cific disk drive. When it has been configured this way, one would say that the
disk drive has been “mounted” to this specific directory. It is also possible to
make a mounted file system to a disk drive that is not on the local computer. In
this case, the directory may be mounted to a file server on the network. As men-
tioned in an earlier chapter, this arrangement on a unix-type computer is referred
to as an NFS mount, where NFS refers to Network File System which is a sort of
disk drive emulation that makes Ethernet type of networking behave like a disk
drive.

Using the unix-type operating system, the full designation of a file could
then look like the following:

/usr/local/user/guy/hardata.dat

Computer Software Basics 57

When it comes time to write a file to a diskette, then one needs to know the
proper directory designation for the desired device. For a floppy drive, a typical
directory might be the following:

/dev/fd0

Now when the user or the CAD software needs to write a file to the floppy
drive, it simply needs to point to the specific directory name (such as referring to
the file as /dev/fd0/write_this_file.txt).

3.2.8 File Format

Although it is not necessarily a function of file management, there is an impor-
tant issue with the way different files are structured on various operating systems.
These issues often relate to the “inter-operability” of CAD software. Since there
are many different CAD programs used on different operating systems at the in-
numerable companies that do design and manufacturing, it is inevitable that files
will need to be exchanged between these systems. A great deal of frustration with
this process can be avoided by learning a little bit about file structure.

First of all, it must be understood that files are just collections of bit pat-
terns. These bit patterns are organized in groups of 8 bits (i.e. 1s and 0s or ONs
and OFFs or voltage HIGHs and LOWs). These 8 bits are known as a byte, and it
turns out that one can easily create 128 different patterns of the 1s and 0s using 7
out of the 8 bits (some systems reserve that last 1 or 0 for special purposes).
These 128 different combinations have been standardized to cover just about all
one needs to put information into a file (things like letters, numbers, punctuation
marks, etc.). These standardized combinations are known as the ASCII codes or
the ASCII table. Referring to Table 3.1, one can see that the upper case letter A is
code 65 (in “decimal” form), and the letter B is code 66, and so on.

Clearly having a standard set of patterns like this is essential to exchanging
files between different systems. The only computer system that does not use the
ASCII codes are the older IBM mainframe computers; they used something
called EBCDIC. However, this system would not be at all typical in CAD appli-
cations currently. If this type of data file is encountered, then an EBCDIC to
ASCII conversion would have to be performed at some point.

3.2.8.1 ASCII Files

Even assuming that all data files on the CAD systems are based on ASCII codes,
there is still more that needs to be understood concerning the file data format.
Often files are referred to as “ASCII files.” Actually, this does not refer to the file
being just being based on the ASCII codes at all. Instead, it means that the file
has a certain use of the codes.

Referring to Table 3.1, it can be seen that there is an ASCII code 13 that
does not indicate a letter or number. It indicates a carriage return or a “CR.” For

58 Chapter 3

TABLE
3.1

Selected ASCII Codes

ASCII code (decimal) ASCII code (hex + 7-bit binary) Description

10 $0A=0001010 Line feed (LF)
12 $0C=0001100 Form feed (FF)
13 $0D=0001101 Carriage return (CR)
27 $1B=0011011 Escape (Esc)
32 $20=0100000 Blank (white space)
65 $41=1000010 Uppercase A
66 $42=1000010 Uppercase B
67 $43=1000011 Uppercase C

some readers (particularly older ones), this will make some sense. The carriage
refers to a piece of a typewriter or teletype machine. These were machines that
were used to create documents and transmit information prior to digital comput-
ers. The carriage was a part of the machine that moved across the paper as letters
were struck onto the paper. To return the carriage meant that it moved back hori-
zontally to begin a new line. Normally, this would be followed by a line feed
(“LF”). This line feed meant that the paper advanced vertically under the carriage
so that the new line of text would be below the previous line. So, when these
teletype (or “tty”) machines were used as computer peripherals, it would be nor-
mal to write the ASCII code 13 and then ASCII code 10 (for carriage return and
then line feed) to start a new line.

Like it or not, this ancient history is written on virtually every computer in
existence. This is because in a file referred to as an ASCII file (which is a com-
mon type of file indeed), one or both of those CR/LF codes are present at the end
of each “line” of a file. It is these codes which indicate to the operating system
that a line has ended, and the next one is starting. When users edit an ASCII file,
they see each of the lines in a structure like a page in a book (refer to Figure 3.3).
However, the computer operating system sees the file as a long string of these
ASCII codes; some of the codes are the data that a user expects to see, and then

FIGURE
3.3

A typical ASCII file as seen by the user.

Computer Software Basics 59

some of the codes indicate the end of lines (refer to Figure 3.4) or other control
codes or unprintable characters. Often, the computer system or operating system
will refer to these lines in the file as records. So these new line codes can also be
referred to as an “end of record.” Finally, these type of files may sometimes be
referred to as text files, flat ASCII files or even just flat files, but “ASCII file” is
probably the most universal terminology.

An important concept to understand in an ASCII file is that it is sufficiently
well structured that virtually any operating system can understand it directly,
since all the data is in these well constructed records. There is no real translation
needed between different operating systems for ASCII files. So, an ASCII file is
generally transferable between a unix system and a Microsoft Windows system.
The only possible difficulty is that one operating system uses only one of the
CR/LF codes and the other uses both, but most data transfer operations between
these systems will not have a problem with this.

One way to try to tell if a file is an ASCII file is to attempt to edit it. Most
operating systems have programs available that allow a user to view the data in a
file directly. The operating system’s file editor program is just going to read the
data in the file and display it on the screen using end of record codes to know
when to break up the file into lines. Two examples of file editor programs would
be “vi” or “dtpad” for unix and “Notepad” for Microsoft Windows. One problem
that may arise when editing these files is record length. If a file is meant to be
edited, then each line will not exceed say 80 or perhaps 132 characters (columns
of letters, numbers, etc.). In this case, all the data should be easily viewed.

Other books

Song of Eagles by William W. Johnstone
The Block by Treasure Hernandez
One Dog at a Time by Farthing, Pen
Illusive by Emily Lloyd-Jones
Laird of the Mist by Foery MacDonell
Wishing for Someday Soon by Tiffany King