Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limitation in the System.IO.FileInfo.get_Length()
Message
From
05/03/2010 05:51:21
 
 
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01452685
Message ID:
01452711
Views:
31
>>>>This works for me:
Dim loDirectoryInfo As System.IO.DirectoryInfo
>>>>        loDirectoryInfo = New System.IO.DirectoryInfo("d:\\tmp")
>>>>
>>>>        For Each loFile In loDirectoryInfo.GetFiles()
>>>>            Dim l As Long = loFile.Length
>>>>            Console.WriteLine("Name: {0} Length:{1}", loFile.FullName, loFile.Length)
>>>>        Next
Also you said the error was 'could not find file' - seems odd that that would occur on the fourth reference to loFile rather than the first ?
>>>
>>>The error message is a complete dummy one which has no reference to the real error. It says that but it is really in reference to the number of characters. So, the file object can be handled. But, when we access the Length property, it bugs.
>>>
>>>I tried dumping loFile.Length into a Long and that is the same problem.
>>>
>>>At first, I thought it was because the client entered a bunch of weird characters in the file name such as a comma, a pound sign and so on. I also found it quite weird that they chose such a long name. But, they are the client. So, we were trying to adapt the application to support such a long file name. But, later on, I found that it is about at that exact location. So, I changed the file name to something like 11111111111111111111111.pdf, where I would have 160 characters. Up to that, it worked. But, as soon as I had one more character, it bugs. I also tried with letters. It was the same situation.
>>>
>>>It might be related to something on that drive. For now, there is a validation in my class to return a message about it instead of generating an error.
>>
>>Michel,
>>
>>Just guessing - but what is the total length of the full path to the file. Could that exceed 260 ?
>
>Interesting.
>See my last post to Michel....


It was the only possibility left in my mind
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform