Login | |
|
 |
RE: need help to exclude a folder - 4/28/2006 7:12:00 AM
|
|
 |
|
| |
ehvbs
Posts: 2204
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
|
Hi kracksmith, Many thanks to your help, time, and effort in resolving my problem. [...] You are welcome - and don't underestimate your contribution to our script: questions go into the answers. Just curious, can the default directory "c:\temp\delsel" be a network directory as in \\prod2\temp\delsel?? Yes, but expect security/permission problems Would I be able to run multiple default directories by just adding as in c:\temp\delsel1, and c:\temp\delsel2, and etc..... ? In prinziple, yes - but: The scalar/single variable sSDir has to be replace by an array Dim aSDirs : aSDirs = Array( "c:\temp\delsel", "\\prod2\temp\delsel" ... ) The specifications of folders/files must use the *correct* leading parts: dicXFP.Add aSDirs( 0 ) + "\dir1\dir11" , 0 dicXFP.Add aSDirs( 1 ) + "\some\dir\on\prod2" , 0 The entry into the recursive traversal has to be put into a loop Else For nIdx = 0 To UBound( aSDirs ) delSelFiles3 oFS, aSDirs( nIdx ), dicXFP, dicEXT, dicPFP, true Next End If You could argue that the folders/files definitions are specific to each start directory - working on the c:\start subtree doesn't need to know about folders to ignore under d:\start. Then we had to arrayify (?) or dictionarize (?) all these dic??? too. By the way, I will be away for the weekend and until wednesday. So do some experiments with the code, but don't let your boss talk you into accepting any deadlines!
|
|
| |
|
|
|
 |
RE: need help to exclude a folder - 5/2/2006 8:36:23 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
|
If it is file manipulation and long paths that is the problem, then you can get around the problem thusly: 1) Check the length of the path. If it is small enough, then move along and do your copy. If not then do this: 2) Find the first \ that occurs before the length limit (InStrRev) 3) Get all of the path from the beginning of the path up to that \ that you just found into a var (call it strTruncatedPath). 4) Map the first open drive letter using strTruncatedPath for where to map it to. 5) Now you can do your copy command using your nwe drive letter and whatever is left of the original path. 6) unmap the drive. There are some things that will make this not work and it is very hacky, but it should work.
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|