Because files are such an integral part of the computing ecosystem, it is crucial to understand the options available in Go for working with files. This section covers some basic operations, such as opening, closing, creating, and deleting files. Additionally, it covers renaming and moving, seeing if files exist, modifying permissions, ownership, timestamps, and working with symbolic links. Most of these examples use a hard-coded filename of test.txt. Change this filename if you want to operate on a different file.
File basics
Creating an empty file
A common tool used in Linux is the touch program. It's frequently used when you need to quickly create an empty file with a specific name. The following example replicates...