Check that file exists: Difference between revisions

Content added Content deleted
(→‎{{header|Python}}: replaced 'exists' with 'isfile' / 'isdir', fixing distinction between file and dir)
Line 1,394: Line 1,394:
os.path.isdir("/docs")</lang>
os.path.isdir("/docs")</lang>


The more generic <code>os.path.exists(path)</code> method will return True if a path exists, being it either a regular file or a directory.
The more generic <code>os.path.exists(path)</code> function will return True if a path exists, being it either a regular file or a directory.


=={{header|R}}==
=={{header|R}}==