This project is read-only.

Opening Files with more than 255 charcters

Dec 9, 2013 at 9:10 PM
Can somebody help me in opening files with more than 255 character length.
With Alphaleonis.Win32.Filesystem.File.Open i'm getting exception with the UNC path
Developer
Dec 10, 2013 at 12:17 AM
Hi Santhoskba86,

It would be way easier if you posted some code to show what you're doing.

Also, you can examine the numerous Unit Tests.

Regards,
Yomodo
Dec 11, 2013 at 9:55 AM
Hi Yomodo,
This is the code i'm trying
Alphaleonis.Win32.Filesystem.File.Open("sFileName ", Alphaleonis.Win32.Filesystem.FileMode.Open, Alphaleonis.Win32.Filesystem.FileAccess.Write);

where sFileName is the file residing inside a directory of length more than 255 characters.
Developer
Dec 11, 2013 at 6:20 PM
Hi,

Alphaleonis.Win32.Filesystem.FileMode.Open and Alphaleonis.Win32.Filesystem.FileAccess.Write do not exist.

You must use the System.IO enums here: System.IO.FileMode.Open and System.IO.FileAccess.Write

If this also doesn't work (it should), post the Exception as well.

Yomodo
Marked as answer by Yomodo on 1/14/2014 at 7:35 PM
Dec 12, 2013 at 8:25 PM
Hi there, please do the following Alphaleonis.Win32.Filesystem. File.Open(Alphaleonis.Win32.Filesystem.Path.GetLongPath("sFileName "), Alphaleonis.Win32.Filesystem.FileMode.Open, Alphaleonis.Win32.Filesystem.FileAccess.Write); Sincerely, Alexandr Normuradov