CS 100 - Computer Literacy, Fall 2004

Lab 3

For this assignment, we will combine a few different tasks.

  1. Change to your web directory on your icarus account.
  2. Create a file in the web directory
  3. Change the permissions on this file so it can be viewed from the web.
  4. In the Lab3 Discussion Board in Blackboard, post a message with the URL of the file you created.
The steps needed to complete the first three tasks of this assignment are in the First Steps section of the ACCC's web page Web Publishing for Beginners. The First Steps section also describes what the URL that is needed for task 4 of this assignment. We will also discuss what is needed below.

Directories

Directories in UNIX are the same thing as Folders in Windows. They are used to organize the files in your account. You could get away without using directories (many Windows users put everything in their My Documents folder), but after a while you have a huge number of files and that gets hard to work with. You can organize each directory by further subdividing it with more "sub-directories" (a directory placed inside another directory).

For example, Prof. Troy creates a directory for each course he has taught. If a course has been taught multiple times, a subdirectory is created for files used during each semester. For example, Prof. Troy's CS100 directory has two subfolders Spring02 and Fall04.

UNIX and Windows have what is called a hierarchical file system. There is one directory/folder at the top-most level and this can have one or more sub-directories/sub-folders at the second level. These sub-directories/sub-folders can also have their own sub-directories/sub-folders which would be at the third level. This continues for however many levels you wish to create. As you change directories/folders, you will normally move up or down one level in the hierarchy.

There are a few directory commands that you will want to know are:

Your Web Directory

Your icarus account should have a special directory called public_html. The files in this directory will be viewable on the World Wide Web through a browser if the permissions for the files are set correctly. If your icarus account does not already have this directory, you will need to create it. The commands to create this directory and set the proper permissions are given in steps 2 and 3 in the First Steps section of the ACCC's web page Web Publishing for Beginners.

File Permissions

In order to for others to see your web files, you need to set the proper permissions on your files. UNIX files have three types of permissions (read, write and execute) and three types of viewers (user, group and others). Certain operations require a file to have certain permissions.

The viewers are the people with accounts on the UNIX system. Even though there are three different viewers, we will treat the viewers of group and others the same. Thus we can divide the viewers in two, the user (or owner) of the file and everyone else.

A simple (and incomplete) description of the types of permissions are given below to show how each permission type is used by the UNIX system. The permission of read on a file allows the file to be viewed. The permission of write on a file allows the file to changed. Thus to edit a file, the file must have both read and write permission. The permission of read on a directory allows the ls command to list the files in that directory. The permission of write on a directory allows a file to be created in that directory. The permission of execute on a directory allows the viewer to change to the directory. Thus you normally want to give yourself read, write and execute permission for any directory you will be working. To view the permissions for a file or directory enter the ls -l command. The permissions will be given in the first column of information of the file listing.

To view a file in your web directory on the web, it needs to have the read permission turned on for all viewers. The chmod command (CHange premission MODe) allows you to change the permissions on a file or directory. The command to set the proper permissions are given in step 5 in the First Steps section of the ACCC's web page Web Publishing for Beginners.

Determining the URL

The URL is the web address of the file that is used to display that file in a web browser. The URL of a file in your public_html directory on the icarus machine is:
     http://icarus.uic.edu/~netid/filename

     where netid is your net-id
     and   filename is the name of the file
Thus the file with the name of temp on the icarus account of troy would be:
     http://icarus.uic.edu/~troy/temp
This idea is also discussed in the final sentences of the First Steps section of the ACCC's web page Web Publishing for Beginners.

Lab Assignment 3

Due: Friday 9/17/2004 by 8:00 am