How to create an empty file or Implement touch using Python
0
1008
The touch is a UNIX utility that sets the modification and access times of files to the current time of day. If the file doesn't exist, it creates the file with default permissions.
To implement touch in Python use the following code
from pathlib import Path
Path('/tmp/file.txt').touch()
If '/tmp/file.txt' does not exists, it will create the file
Comment here