UweKeim / ZetaLongPaths

A .NET library to access files and directories with more than 260 characters length.
https://nuget.org/packages/ZetaLongPaths
MIT License
142 stars 28 forks source link

Short path name on network paths fails #20

Closed mat100payette closed 6 years ago

mat100payette commented 6 years ago

I have been able to create files on a network path (ex: \\my.net.foo\some\long\path\bar.txt) but then I encounter 2 problems:

  1. I can't do anything with the file because obviously Explorer can't support it for some reason. So how would I proceed to delete the file?
  2. When I try to get a short path name on what it seems to be any network path, even if part of it is mapped to a drive (ex: Z:\long\path\bar.txt, where Z: is \\my.net.foo\some), the returned path is always longer than the original path.

Some additionnal info:

I'm thinking it may have to do with the protocol used for the network file system as described here but other than that I'm clueless. If that truly is the problem (I don't have the info concerning what technology is used yet) then there's not much I can do.

Am I on the right track or am I missing something?

UweKeim commented 6 years ago

I'm not sure how this is related to the ZetaLongPaths library.

Can you provide a MCVE?

mat100payette commented 6 years ago

A MVCE is a little bit hard to provide since the problem appears only on shared file systems. That being said, I had done some research and I was told that the protocol that the company used did not support short paths.

(I dont have the exact code nearby) Basically, all I was trying to do was to create a new ZlpFileInfo("\woah.this.path\is\loooong...") and then open a stream to it so that it would be created on the FS. It did work kinda, as in it created the file on the shared FS, but the short name version of the file would simply not be shorter than its normal name. That's where he protocol thing comes into play I'm fairly sure...

On another note, I notoced that if I create a file on my desktop (not related to shared FS), like "C:/desktop/teeeeeeeeeee...xt.txt" using Zlp (because windows wouldnt let me obviously), then I cant do anything with the file manually. It becomes impossible to open it, delete it, rename it, etc. because windows complains that the filename is too long. Is there a way to avoid such a thing ?

Thank you for your time. Mat

UweKeim commented 6 years ago

Thanks, Mat. I've never experienced the behaviour you describe regarding your desktop files.

This is because I'm using my library for the solely purpose of handling too long directory paths because of the total nested directories add up to more than MAX_PATH characters in total.

I've never dealt with single components (file name or directory name) of the complete path being more than MAX_PATH characters long.

I could imagine that a lot of applications and Windows components do not handle this very well.

UweKeim commented 6 years ago

If it is OK for you, I'm closing the issue here now, since I do think it is not releated to ZetaLongPaths.

OK?

mat100payette commented 6 years ago

Fair enough ! I personally do not need the help anymore and it doesn't seem to be a common problem.

Have a nice day. Mat