Join Kevin Skoglund for an in-depth discussion in this video Entries, part of Ruby: Files, Formats, Templates.
- [Kevin] In this movie, we're going to learn…how to work with the contents of directories,…and we're going to do that using something called entries.…So a directory has contents, right?…There's things inside of it.…There could be files.…There could be folders.…One way that we can get access to those…is by using the entries method on the Dir class.…We've provided a file path,…and that tells us what directory we're targeting,…and it comes back and it returns an array…of the entries that are in that directory.…So what are entries?…It's certainly going to be files that are in the directory,…and it's directories that are in the directory,…but it also includes a bit more.…
It includes entries for dot and dot dot.…If you're familiar with working with Unix,…it's very similar to if you do the command ls -la.…You get back a list of the entries…that are in the current directory,…and you'll see that those entries include…not only the three files we can see,…accessing_files, file_paths, and groceries.txt,…but also an invisible file called .DS_Store,…
- File system basics
- Writing to and reading from files
- Renaming, deleting, and copying files
- Creating and editing directories
- Working with common data formats
- ERB templating
Skill Level Beginner
Ruby on Rails 5 Essential Trainingwith Kevin Skoglund10h 21m Beginner
1. The File System
2. Work with Files
3. Work with Directories
4. Common Data Formats
5. ERB Templating
- 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.