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 higher-level convenience functions for working with files.
In the next chapter, we will cover the topic of forensics. It will cover things such as looking for anomalous files that are extremely large or recently modified. In addition to file forensics, we...