SystemInfo not available when path read MaxPath

Sep 26, 2011 at 1:42 PM

 

Hi just tried your library maybe I did something wrong but here is the case :

- I change the usage from System.Io to Alphaleonis.Win32.Filesystem; 
- I successfully initiate the command FileInfo finfo = new FileInfo(file); with path greater that the max-path limitation no pb
- I successfully retrieve information about those file like name, extension , full path and so forth .

The problem is when I try to receive information about SystemInfo class , I got the message :

finfo.SystemInfo.FileSize '((Alphaleonis.Win32.Filesystem.FileSystemInfo)(finfo)).SystemInfo' is null long. therefore :

- I can t retrieve size of the file
- I can t retrieve dates information either from base class or SystemInfo  

+ LastAccessTime {01/01/0001 12:00:00 AM} System.DateTime
+ LastAccessTimeUtc {01/01/0001 12:00:00 AM} System.DateTime
+ LastWriteTime {01/01/0001 12:00:00 AM} System.DateTime
+ LastWriteTimeUtc {01/01/0001 12:00:00 AM} System.DateTime

 

Note : I have this problem only with path higher that maxpath limit otherwise no problem.

REF : Visual Studio , AlphaFS 1.5 , .Net Framework 2.0 

Can you please assist , Thanks in advance

Ricardo

Sep 26, 2011 at 5:33 PM

Hello Ricardo,

to use long path names obtain their proper format like this one

string myLongPath = Path.GetLongPath(<anypath>);

FileInfo myFifo = new FileInfo(myLongPath);

that should do the job.

Sorry for not having enough time to write a series of tutorials with examples.

Sep 26, 2011 at 8:38 PM

It's working perfectly with your instructions.

Thank you very much.

Ricardo