rec5-2010 - mFkJ LJtHwI ±²LJtHwI file_exists.c Checks if...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
CSci 4061 Recitation 5
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Agenda Debugging with gdb Filesystem/directory handling (through example programs)
Background image of page 2
gdb gdb is the standard debugger for many programming languages -g in compilation to enable gdb gdb obj //start gdb with obj program (gdb) run (arg <arguments>) (gdb) s for step execution (gdb) p for print variables (gdb) br to set breakpoint (gdb) help
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
gdb (demo) Good screencast: http://vimeo.com/2831923
Background image of page 4
Some Essential System Calls mkdir() – creates a directory readdir() – reads a directory scandir() – scans a directory opendir() – opens a directory open() – opens a file close() – closes a file lseek() – moves the file pointer to a desired place getcwd() – returns the current working directory
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Programs we will discuss mkdir.c getcwd.c file_exists.c is_dir.c rename.c size.c perm.c copy.c myls.c
Background image of page 6
mkdir.c Creates a directory mFkJ mkINr ±²mkINr ,INrJHtorynFmJ.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
getcwd.c Get current working directory
Background image of page 8
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 10
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 14
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 16
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: mFkJ LJtHwI ±²LJtHwI file_exists.c Checks if the file exists or not mFkJ KNlJDJxNsts ±²KNlJDJxNsts ,KNlJnFmJ. How do you check if a file is executable? is_dir.c Checks to see if the directory is readable mFkJ NsDINr ±²NsDINr ,INrnFmJ. Is the directory there? Or is it permission problem? rename.c Renames a file mFkJ rJnFmJ ±²rJnFmJ ,HurrJntDnFmJ. ,nJwDnFmJ. How to avoid overwriting? How to move to a directory? size.c Find the size of a file mFkJ sNzJ ±²sNzJ ,KNlJnFmJ. Size of a directory? perm.c Get the permissions on a file mFkJ pJrm ±²pJrm ,KNlJnFmJ. Is the sticky bit on? copy.c Copies a file to another file mFkJ Hopy ±²Hopy ,orNLNnFl. ,Hopy. copy an entire directory? myls.c Poor man's ls program mFkJ myls ±²myls ,INrJHtorynFmJ. How do you make it support other options that ls supports? That's all! Thanks....
View Full Document

This note was uploaded on 10/21/2011 for the course CSCI 4061 taught by Professor Tripathi during the Spring '08 term at Minnesota.

Page1 / 16

rec5-2010 - mFkJ LJtHwI ±²LJtHwI file_exists.c Checks if...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online