Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Recursive iteration in folders

Recursive iteration in folders

2004-08-13       - By Bernard Lebel

 Back
Reply:     1     2     3  

Hello,

Ok I guess it's pretty simple, but I can't find it. Is there a way to
recursively iterate through folders on disk?
What I'm trying to do is to point to a root path, then start a loop that
will look if the folder contains subfolders, then will look each subfolder
to see if they have subfolders, and so on until all folders have been
checked and no more folder is found.

I guess a while loop would be perfect for the job, however I have tried
several ways of putting it and it stops on the first iteration.


// Get final path to lookup
var sPath = \\mypath\blahblahbla;

var fso = new ActiveXObject( "Scripting.FileSystemObject" );

var oFolder, oSubFolders;

// Get folder
oFolder = fso.getfolder( sPath );

logmessage( "First oFolder: " + oFolder );

while( oFolder.subfolders.count > 0 )
{
   oSubFolders = oFolder.subfolders;
   for( var oSubFoldersEnum = new Enumerator( oSubFolders );
!oSubFoldersEnum.atEnd(); oSubFoldersEnum.moveNext() )
   {
       oFolder = oSubFoldersEnum.item();
       logmessage( oFolder );
   }
}



Thanks
Bernard

---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi