GetDirectories Throwing PathTooLong Exception

MaxinA

Member
Joined
May 11, 2007
Messages
15
Location
Canada
Programming Experience
10+
Hi,

So, I am building a Permissions Crawler for shared drives, which by its nature, needs to recurse through a potentially deep directory structure. My app is working swimmingly, until I try to call:

System.IO.Directory.GetDirectories(strCurrFolder)

When strCurrFolder is =

Y:\ABC\ABC Corporate Record\PMO\Records_Management\1014 - COE - RIM Foundation 2006\5 Reference Material From Client\COE - Internal reference - Backup from server 2007 Feb 2\Corporate Records Management Services\Position Descriptions\Omnixxx Systems Administrator

So, effectively GetDirectories is throwing a PathTooLong Exception. Can someone tell me how to get around this??

Thanks,

Andrew
 
I don't know if this would work but you might try setting Environment.CurrentDirectory at each level ad then you would not have to specify the full path to GetDirectories each time. Envirnoment.CurrentDirectory doesn't indicate that it throws a PathTooLongException so it may well work.
 
Back
Top