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 one of the common touch use case of creating an empty file.

There are limited uses to creating an empty file, but let's consider one example. What if there was a service that wrote logs to a rotating set of files. Every day a new file is created with the current date, and the day's logs are written to that file. The developer might have been smart and put very strict permissions on the log files so that only administrators can read them. But, what if they left loose permissions on the directory? What would happen if you created an empty file with ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.