Sign in to follow this  
Followers 0
failedtocompile

is it possible? recursive search + addtional

2 posts in this topic

Hi Guys,

Just enquiring if Autoit can support functions to recursively scan a root folder for targeted file extension say .los, and check File encoding, then output file folder path and encoding type.

Example of desired output file.

C:\Documents and settings\user123\archives\testing.los [ANSI]

C:\Documents and settings\user123\archives\testing123.los [uNI]

I have searched the help file and forum posts and have summarised basic functions I would need to use, but this may be completely wrong so any help would be greatly appreciated.

FileGetEncoding()

FileFindFirstFile()

FileFindNextFile()

FileGetAttrib()

FileWriteLine()

FileSelectFolder()

_FileListToArray()

StringInStr()

StringRight()

Dim $FolderName = @MyDocumentsDir
Dim $FileCount = 0

ScanFolder($FolderName)

;SendMail()

;CheckEncoding()

Func ScanFolder($SourceFolder)
    Local $Search
    Local $File
    Local $FileAttributes
    Local $FullFilePath

    $Search = FileFindFirstFile($SourceFolder & "\*.*")

    While 1
        If $Search = -1 Then
            ExitLoop
        EndIf

        $File = FileFindNextFile($Search)
        If @error Then ExitLoop

        $FullFilePath = $SourceFolder & "\" & $File
        $FileAttributes = FileGetAttrib($FullFilePath)

        If StringInStr($FileAttributes,"D") Then
            ScanFolder($FullFilePath)
        Else
            LogFile($FullFilePath)
        EndIf

    WEnd

    FileClose($Search)
EndFunc

Func LogFile($FileName)
    FileWriteLine(@ScriptDir & "\List.txt",$FileName)
    $FileCount += 1
    ;ToolTip($FileName,0,0)

EndFunc

#cs
Func CheckEncoding()
$Encode_Type = FileGetEncoding()
$PstSearch =
FileWriteLine(@ScriptDir & "\filelist2.txt", $PstFile

Func SendMail()
    EndFunc
    #CE

Would anyone have something already created I maybe able to work on?

Or any code tips to get me started?

Thanks in advance.

ftc

Share this post


Link to post
Share on other sites



Would anyone have something already created I maybe able to work on?

Or any code tips to get me started?

Thanks in advance.

ftc

i did a recursive file search a while back (still there somewhere i'm sure) but there were faster ways to accomplish the same goal, like doing a dir/s file mask and having that captured and sorted... search forum for filesearch and you'll see a few ways to skin that particular cat

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0