Probably the code uses a StreamWriter with an incorrect empty path. Maybe the DirSearch can be fixed or reimplemented.
Path name issue or problem
Peter_1985
2,711
Reputation points
Hi,
Is this error
Exception/StackTrace - Empty path name is not legal. at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
at ScanFolder.Program.DirSearch(String directoryPath, String par_OutFile)223344
owing to the folder name "Program Files (x86)" below? How to ensure that we can refer to the path having one space to that?
OrigPath = "C:/Program Files (x86)/BB/Logs/";
```
Accepted answer
1 additional answer
Sort by: Most helpful
-
Bruce (SqlWork.com) 71,266 Reputation points
2024-01-01T01:16:25.8+00:00 unless its a typo you have an invalid path. try:
OrigPath = "C:\\Program Files (x86)\\BB\\Logs\\";