Join Dan Gookin for an in-depth discussion in this video Doing a file round-robin, part of Code Clinic: C.
- The bulk of the main function…in my image analysis solution…deals with locating the names of all files…in the current directory twice.…The code starts by opening the current directory.…All directory entries are read…with sub-directories and dotfiles skipped.…When a real file is found, it's displayed as a source.…The read_jpeg function is then called,…which returns zero for a successful read,…or some other value otherwise.…Upon finding a real jpeg file,…the directory is searched again.…
Once more directories and dotfiles are skipped.…The current file name is also skipped,…so there's no need to compare a file with itself.…Beyond that, every other file is opened…and compared with the original.…If the compare function returns the value one,…then the current file is flagged as a match.…The cycle then repeats…for every other file in the current directory.…The else condition handles non-jpeg files.…Because I wrote my own error handler,…the error value return from the read jpeg function…let's me choose a proper message to display,…
Dan introduces challenges and then provides an overview of his solutions in C. Challenges include topics such as statistical analysis, searching directories for images, and accessing peripheral devices.
Skill Level Beginner
Q: I am unable to access the Lake Pend Oreille data from outside the U.S.
A: A static copy of this data is provided here for lynda.com members outside of the U.S.
1. Problem One: Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Problem Four: Accessing Peripherals
5. Problem Five: Recursion and Directories
6. Problem Six: Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.