FSU COP 4342 - Building blocks for Unix power tools (29 pages)

Previewing pages 1, 2, 3, 27, 28, 29 of 29 page document View the full content.
View Full Document

Building blocks for Unix power tools



Previewing pages 1, 2, 3, 27, 28, 29 of actual document.

View the full content.
View Full Document
View Full Document

Building blocks for Unix power tools

40 views


Pages:
29
School:
Florida State University
Course:
Cop 4342 - Unix Tools (3)

Unformatted text preview:

Fall 2006 Building blocks Building blocks for Unix power tools Now that we have given a good overview of a lot of the better Unix tools I want to take some time to talk about our toolset for building Unix programs The most important of these are the system calls COP 4342 Fall 2006 Building blocks Building blocks for Unix power tools A Unix system call is a direct request to the kernel regarding a system resource It might be a request for a file descriptor to manipulate a file it might be a request to write to a file descriptor or any of hundreds of possible operations These are exactly the tools that every Unix program is built upon COP 4342 Fall 2006 Building blocks File descriptor and file descriptor operations In some sense the mainstay operations are those on the file system COP 4342 Fall 2006 Building blocks File descriptor and file descriptor operations Unlike many other resources which are just artifacts of the operating system and disappear at each reboot changing a file system generally is an operation that has some permanence although of course it is possible and even common to have RAM disk filesystems since they are quite fast and for items that are meant to be temporary anyway they are quite acceptable COP 4342 Fall 2006 Building blocks Important file descriptor calls A file descriptor is an int It provides stateful access to an i o resource such as a file on a filesystem a pseudo terminal or a socket to a tcp session open close create a new file descriptor to access a file deallocate a file descriptor COP 4342 Fall 2006 Building blocks Important file descriptor calls dup dup2 duplicate a file descriptor duplicate a file descriptor COP 4342 Fall 2006 Building blocks Important file descriptor calls fchmod fchown change the permissions of a file associated with a file descriptor change the ownership of a file assocaited with a file COP 4342 Fall 2006 Building blocks Important file descriptor calls fcntl ioctl miscellaneous manipulation of file descriptors



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Building blocks for Unix power tools and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Building blocks for Unix power tools and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?