Summary
After reading this chapter, you should be now familiar with some of the different ways to interact with files and feel comfortable performing basic operations. The goal is not to memorize all of these function names, but to be aware of what tools are available. This chapter can be used as a reference if you need sample code, but I encourage you to create a cookbook repository with snippets like these.
The useful file functions are spread across multiple packages. The os package contains only the basic operations for working with files such as opening, closing, and simple reads. The io package provides functions that can be used on reader and writer interfaces at a higher level than the os package. The ioutil package provides even ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access