I want to check if a string represents the full path to a file, for example:
p = 'C:\my\custom\path.txt'
File does not exist, so commands such as isdirand exist, I return false, but still a format string is a valid path for my operating system and the next - not because it is an invalid character for the file name:
p = 'C:\my\custom\:path.txt'
So, I would like to know how to check if a string matches a valid file path without requiring the file to actually exist.
source
share