Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
More on long path
Message
From
31/05/2012 15:50:25
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
More on long path
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01544991
Message ID:
01544991
Views:
63
Recently, I created a thread about a long path I have to deal with.

Basically, a file name exists in a path. The path and the file name exceeds 260 characters. Thus, this creates an error if we try to verify if this file exists. The method I am using had been adjusted to add a second level of verification in case File.Exists() cannot find the file. This will be the case if the full path exceeds 260 characters. The method will then fall in the second level of verification to do a split, first check for the existence of the directory and then check for the file in that directory.

However, in order to check for a file in a directory, I am using this approach:
loFiles = loDirectoryInfo.GetFiles(lcFilter)
But, I get this:

"The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters."

loDirectoryInfo is properly initialized from a 101 character length. lcFilter is the file and contains 158 characters. Adding the \ between the two gives 260 characters. That produces the error. I am looking for an alternative to detect the presence of a file. In such circumstances, I would need an alternative route as this exists on the disk but I can't verify if it exists.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform