How to validate a string is a valid path
Posted: 28 Jan 2020 21:59
Challenge:
- the string path is likely to be on a remote computer (I'm testing backup path returned for some remote SQL servers)
- you cannot try to create the path locally (after all it may be a drive letter not available locally)
- use the minimum lines of code (I can foresee a for loop with : and \ as delimiters)
That's a question... for dummies like me. On Linux it'd be very easy with a simple regex validation.
Have any of you guys done this before?
Would a simple pipe findstr /R do the trick?
thanks
- the string path is likely to be on a remote computer (I'm testing backup path returned for some remote SQL servers)
- you cannot try to create the path locally (after all it may be a drive letter not available locally)
- use the minimum lines of code (I can foresee a for loop with : and \ as delimiters)
That's a question... for dummies like me. On Linux it'd be very easy with a simple regex validation.
Have any of you guys done this before?
Would a simple pipe findstr /R do the trick?
thanks