Link to home
Start Free TrialLog in
Avatar of rogaut1
rogaut1

asked on

Create Directory with DirectoryInfo class

Hi,

   I am using the DirectoryInfo class to create directories. However there is a 260 character limitations to the length of
   the directory name which I maxing out on. Any way around this ?



Thanks


Robert
Avatar of _TAD_
_TAD_



What kind of directory has a name that is more than 260 characters?!?
(hmm... and I thought windows set a limit at 254 chars... odd that .Net lets you add a few more.  I could be wrong though.)


At any rate, I am going to guess that you are NOT creating a directory name of 260+ characters, but are in fact trying to create a subdirectory several directories deep.

Assuming that is the case, you could get to 260 characters pretty fast.


If this is the case, you do not want to use DiretoryInfo class.  This class is geared for Instances of directories.


use this code:

Directory.CreateDirectory(strAReallyLongDirectoryStructure);


Ack!


Ok... I tried out my own code and got the same error.

It looks like you'll have to do it recursively in order to get it done.
ASKER CERTIFIED SOLUTION
Avatar of _TAD_
_TAD_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rogaut1

ASKER

Thanks for your help !

I will have to convert the names I guess....


Robert