computer systems 2010-2011 week 10: file organisation alma whitfield

31
Computer Systems 2010-2011 Week 10: File Organisation Alma Whitfield

Upload: randolph-knight

Post on 26-Dec-2015

217 views

Category:

Documents


2 download

TRANSCRIPT

Computer Systems

2010-2011

Week 10: File OrganisationAlma Whitfield

2

Previously covered Components of a Computer System How a program in main memory is

executed making use of input and output devices connecting with other computers

3

This Week See how programs and data are

permanently stored on a computer system

Organise files using the Windows Explorer Graphical User Interface

4

Recap The CPU processes instructions Before this can happen the

Instructions need to be fetched from main memory (RAM)

Compared with the hundreds/thousands of applications on your computer RAM is small e.g. 2 GB of RAM 400 GB of hard disk (1 GB = 1 gigabyte = 1,000 million bytes)

5

Recap When you switch off the computer

the contents of RAM are lost Where does RAM get its data from?

6

Files The instructions and data are

organised into files stored on secondary storage such as a hard disk

A file can be described as a named collection of bytes representing instructions or data

7

Secondary Storage Secondary Storage is effectively a

huge data structure for storing files

Data structures include Tables, Pointers and Linked Lists (more on this in SPS after Christmas)

How the data structure organises and stores the data is dependent on the type of Table, Pointers and Linked List being used

8

File names Early PCs

File names restricted to 8 characters maximum followed by up to 3 characters after a full stop

e.g. FileOrga.doc Modern PCs

File names can be any length up to 256 characters

Can include spaces e.g. FileOrganisation.doc

9

Files and Secondary Storage Devices such as hard disc and CDs,

DVDs and pen drives can store files permanently i.e. even when the device is switched off these devices are referred to as

secondary storage

10

File Types Data files Program files Source Code Files

11

Data files Bytes represent text, pictures,

sounds, movies The files can be opened or played

or edited by appropriate programs e.g. Notepad program for text files e.g. Word program for Word document

files e.g. Windows Media Player program for

video and audio files e.g. Data processing programs for

customer record files

12

Program files Bytes represent instructions Two main varieties of program file

exe files – bytes are machine code instructions (as in 3-Bit)

batch files – bytes are text containing operating system commands

13

Program files1. Application Programs:

Microsoft word Internet Explorer etc.

2. System Programs: operating systems like Windows or

Linux language translators such as Java,

Pascal, C, C++ that translate high level language programs into machine code

14

Source code files Bytes represent text (they can be

regarded also as text files) The text is human-readable program

instructions e.g. written in Java before they get translated into machine code by compilers

15

Organising files Thousands of files can be held in

secondary storage Organising the files is a job for the

operating system

16

Operating System and Files Q. When you double click on a file,

how does the Operating System know what to do with that file?

A. Filename extensions (also known as file extensions for short)

17

File Extensions Files have names

They also have something else called extensions (the letters that follow the last dot (.) in a file’s name.

The extension reveals the type of each file e.g. cars.jpg, (this is an image extension)

sales1.doc (this is a Microsoft Word document)

18

For example The following extensions indicate

that the data contained within the file is executable .exe .com .bat .cmd

19

Saving data from Applications When you save data from an

application the application will usually automatically tag on the extension .doc .ppt .mdb .txt

You could also tell the application to save as a different file type such as .htm

20

File Attributes Files have attributes associated

with them. An attribute is another word for a

charactistic For example you could make a file

READ-ONLY, HIDDEN, ARCHIVE

Right Mouse click and select properties on the file to set these attributes

21

Operations on Files Create a file / Delete a file Open a file / Close a file Read data from a file Write data to a file Reposition the current file pointer in a file Append data to the end of a file Truncate a file (delete part of its

contents) Rename a file Copy a file

22

Using the PC Filing System PCs running popular operating systems such

as Windows and Linux organise computer files into directories (sometimes called folders) on your secondary storage (e.g. hard drive).

These directories are based on a hierarchical structure, where the root directory (denoted by \ ) is at the top of that structure.

23

Directory Trees A directory of files can be contained

within another directoryThe directory containing another is usually called the parent directory, and the one inside is called a subdirectory

Directory tree A logical view of a file system; a structure showing the nested directory organization of a file system

Root directory The directory at the highest level

24

The file directory

A directory is a table listing files and their location on the disc

Directories are called folders in Windows

24

25

The file directory

25

In practice, the black blobs are numbers giving the addresses of the locations of the files on the disc surface

26

Directory entries can be other directories leading to ...

... a hierarchical directory structure

i.e. folders within folders

i.e. a tree data structure

26

27

Path: a file’s full name

Write down the full path of POOLS \LETTERS\BEGGING\POOLS

27

28

MS Windows hierarchical directory structure

28

29

MS Windows hierarchical directory structure

29

30

File Handling in Microsoft Windows Microsoft windows is based on a graphical

user interface (GUI). This makes handling files and directories simple.

Using Windows Explorer you can: Find files and folders Copy files and folders Move files and folders Delete files and folders Create folders

Demo ... more in the seminar

31

Next week File handling in MS-DOS