Upload
marian-miles
View
216
Download
0
Embed Size (px)
Citation preview
Hans-Peter Plag October 9, 2014
Session 2Storing InformationFile Formats
http://www.mari.odu.edu
Accessing InformationProcessing Information
Hardware: (smart phone, tablet,) laptop/PC, work station, main frame, clusters, cloud
Operating system: “An operating system (OS) is software that manages computer hardware and software resources and provides common services for computer programs. The operating system is an essential component of the system software in a computer system. Application programs usually require an operating system to function.”
User interface: •non-interactive•teletype (command line)•button/keys•graphical user interface (GUI)
Application: Application software is a set of one or more programs designed to carry out operations for a specific application. Application software cannot run on itself but is dependent on system software to execute. Examples of application software include MS Word, MS Excel, a console game, a library management system, a spreadsheet system etc.
User: •type: human, program, equipment,•level: low to highly experienced, experts•constraints: concepts, value systems, capabilities, ...
User InterfaceUser InterfaceUser InterfaceUser Interface
User InterfaceUser InterfaceUser InterfaceUser Interface
Information is stored in files
How is information stored in files? We’ll come back to this
Previously: most operating system did not use file name as information
Today: many operating system, GUIs and applications use file type as information:.txt, .doc, .docx, .ppt, .pdf, .jpg, .exe, .py, .f90, ...
Files are organized in file systems
Linux/Unix:/directory/sub-directory/sub-directory/...
File system control:Linux: mainly up to userMac: some predefined directories needed for GUI/applications to work
Discussion:In system-controlled file systems, it can be difficult to find somethingIn user-controlled systems, users need to have organization skills
Information is stored in files
How is information stored in files?
Basics about number systems
Decimal number, can be represented as:
Any decimal number can be represented as:Any number to basis b can be represented as:
Information is stored in files
How is information stored in files?
Basics about number systemsSpecial basis is b = 2:
Example:
binary number system
Other important systems:b = 8: Octalb = 16: Hex
How is information stored in files?
Basics element in a computer is a switch with two states: 0 and 1
All information is stored using the binary number system
Byte: 8 bits
bitbitbitbitbytebytebytebyte
Can represent numbers from 0 to 255
Can also be used to represent 256 symbols, characters, codes
How is information stored in files?
Fundamental coding is ASCII
ASCII: American Standard Code for Information Interchange: is a character-encoding scheme. Originally based on the English alphabet, it encodes 128 specified characters into 7-bit binary integers. The characters encoded are, numbers 0 to 9; lower case letters a to z; uppercase letters A to Z; basic punctuation symbols; control codes that originated with Teletype machines; and space.
How is information stored in files?
Fundamental coding is ASCII
Extended ASCII (or high ASCII) is eight-bit or larger character encodings that include the standard seven-bit ASCII characters as well as others. The use of the term is sometimes criticized,[1][2][3] because it can be mistakenly interpreted that the ASCII standard has been updated to include more than 128 characters or that the term unambiguously identifies a single encoding, both of which are untrue.
How is information stored in files?
File coding:- ASCII/extended ASCII: source code, text files, data, ... - can be edited in a text editor, printed, displayed in screen, ...- binary: executable programs, application files (word, excel, ...), graphics, databases, ... - cannot be edited in text editor, printed, viewed; require program to read/decode
How is information stored in files?
ASCII File structure:- depends on programming language- earlier languages: record based- today: many systems make no assumptions about structure
Binary files: - operating system, program language, user dependent
- Unix/Linux - Mac OS Classic - Windows (MS Dos)
Basic operations to access information stored in a file are:- opening a file- reading a file- decoding information- processing information- writing information to file- closing a file
Input from keyboard/screen can be consider similar to input from files- Fortran: reads records, not individual characters- C/C++: can read characters and records- PHP/Python: read full files or parts
Use a simple syntax to outline a procedure:- read an ASCII file (generated in an editor)- Separate the contents into logical record indicated by the string ‘\n’ - Write a file with records separated by ‘|’
Use a simple syntax to outline a procedure that can decode a command line consisting of:command-name p1=value p2=value ... pn=value