0

Using Windows 10, I am accessing a shared directory on the network. The directory has a number of nested folders holding images. The folder names tend to get pretty long. When using cv2 to read and write images, I'm getting a "No such file or directory" error. The length of the path is longer than 260. I tried appending "\\?\\" to the beginning of the path, but still no luck. Thanks in advance for the help.

enter image description here

img.save() is still running into issues.

  • you could try to use `net use` and mount a network drive at some already deep point. – Jean-François Fabre Aug 10 '17 at 20:27
  • i believe `os.chdir(os.path.join(*([os.pardir] * NUM_TIMES)))` is what you looking for – OLIVER.KOO Aug 10 '17 at 20:28
  • Thanks for the pointers. Instead I just set os.chdir() back to its original path(where code is located). I did this because the path that I pass to outputImage() is on the network and continuously changes(command line argument), and I need to be in the code directory to execute scripts. Do you see where the error is? The length is still an issue. – Mukesh Gokul Kastala Aug 11 '17 at 00:28
  • you can prefix your path with `'\\?\'` and windows will allow it to be long – Erik Aronesty Oct 04 '19 at 15:19

0 Answers0