Which is the preferred way to check if a file exists and if not create it?
To check if a path is an existing file:
Return
True
if path is an existing regular file. This follows symbolic links, so bothislink()
andisfile()
can be true for the same path.