marcusdoc Posted April 10, 2005 Share Posted April 10, 2005 how does one do a recursive directory scan? (I can see the utilization of FileFindFirstFile etc to perform a single directory scan but I don't see anything for directories). here's the project in a directory there are multiple directories contained within that are created on a daily basis. scan the directories contained within and only delete the directory (and it's contents) based upon age (say anything older than 14 days) thanks in advance Link to comment Share on other sites More sharing options...
Trainee Posted April 10, 2005 Share Posted April 10, 2005 You might want to take a look at SendMessage,hlist,LB_DIR,DDL_FLAGS,addr path The other constants for wParam are: Const DDL_READWRITE = &H0 Const DDL_READONLY = &H1 Const DDL_HIDDEN = &H2 Const DDL_SYSTEM = &H4 Const DDL_DIRECTORY = &H10 Const DDL_ARCHIVE = &H20 Const DDL_DRIVES = &H4000 Const DDL_EXCLUSIVE = &H8000& Const DDL_POSTMSGS = &H2000 Const DDL_FLAGS = DDL_ARCHIVE Or DDL_DIRECTORY Outcastprogramming Link to comment Share on other sites More sharing options...
Ejoc Posted April 10, 2005 Share Posted April 10, 2005 Search the forum for recursive, I got this thread right away and with a slight change it should work for you:http://www.autoitscript.com/forum/index.ph...topic=10246&hl= Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
eJan Posted April 10, 2005 Share Posted April 10, 2005 Could be useful, AI 3.0.102 function to delete folder content (I use it to empty Favorites)$favdir = @FavoritesDir_DirRemoveContents($favdir)Func _DirRemoveContents( $sPath ) Local $sPattern Local $sFile Local $hFile If StringRight( $sPath, 1 ) <> "\" Then $sPath = $sPath & "\" $sPattern = $sPath & "*.*" If Not FileExists( $sPath ) Then Return 0 FileDelete( $sPattern ) $hFile = FileFindFirstFile( $sPattern ) If @error Then Return 0 While 1 $sFile = FileFindNextFile( $hFile ) If @error Then ExitLoop If $sFile <> "." And $sFile <> ".." Then If StringInStr( FileGetAttrib( $sPath & $sFile ), "D" ) Then DirRemove( $sPath & $sFile, 1 ) EndIf EndIf WEnd FileClose( $hFile ) Return 1EndFunc Link to comment Share on other sites More sharing options...
Developers Jos Posted April 11, 2005 Developers Share Posted April 11, 2005 how does one do a recursive directory scan? (I can see the utilization of FileFindFirstFile etc to perform a single directory scan but I don't see anything for directories).here's the projectin a directory there are multiple directories contained within that are created on a daily basis. scan the directories contained within and only delete the directory (and it's contents) based upon age (say anything older than 14 days)thanks in advance<{POST_SNAPBACK}>Posted this a while ago that does exactly what you are asking for : #30391 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
marcusdoc Posted April 11, 2005 Author Share Posted April 11, 2005 (edited) Posted this a while ago that does exactly what you are asking for : #30391<{POST_SNAPBACK}> thanks everyone for your help(now to figure out how this script works)wow - that's complex scripting - great job Edited April 11, 2005 by marcusdoc Link to comment Share on other sites More sharing options...
marcusdoc Posted April 11, 2005 Author Share Posted April 11, 2005 incredible - even with a log file and the ability to stop the process Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now