Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Цитата Sylver Dragon:
Файлы из прикреплённого архива распаковать в корень справки.
Запустить скрипт. »
Да, но там немного структура неверная, как получал список? Лучше такой скрипт использовать, и его кстати нужно прогнать сразу и выложить в архиве распакованную-пропатченную справку, чтобы каждому не приходилось патчить заново....

Код: Выделить весь код
#Include <File.au3>

$aFilesList = _FileListToArrayEx(@ScriptDir, "*.htm", 1, -1)
If @error Then Exit

For $i = 1 To $aFilesList[0]
    _ReplaceStringInFile($aFilesList[$i], "charset=iso-8859-1", "charset=windows-1251")
Next

;$iMode <= 0 -> Folders + files
;$iMode = 1 -> Files only
;$iMode = 2 -> Folders only
Func _FileListToArrayEx($sPath, $sMask="*", $iMode=-1, $iLevel=-1)
    If Not StringInStr(FileGetAttrib($sPath), "D") Then Return SetError(1, 0, 0)

    $sPath = StringRegExpReplace($sPath, "\\+$", "")
    $sMask = "(?i)" & StringReplace(StringReplace($sMask, ".", "\."), "*", ".*")

    StringReplace($sPath, "\", "")
    Local $iLevel_Slashes = @extended + 1

    Local $aPathesArr[2] = [1, $sPath]
    Local $hSearch, $sFindNext, $i, $iIsDir

    While $i < $aPathesArr[0]
        $i += 1

        $hSearch = FileFindFirstFile($aPathesArr[$i] & "\*")
        If $hSearch = -1 Then ContinueLoop

        While 1
            $sFindNext = FileFindNextFile($hSearch)
            If @error Then ExitLoop

            $iIsDir = StringInStr(FileGetAttrib($aPathesArr[$i] & "\" & $sFindNext), "D")

            If $iMode < 2 Or ($iMode = 2 And $iIsDir) Then
                If Not $iIsDir And Not StringRegExp($sFindNext, $sMask) Then ContinueLoop

                $aPathesArr[0] += 1
                ReDim $aPathesArr[$aPathesArr[0]+1]

                $aPathesArr[$aPathesArr[0]] = $aPathesArr[$i] & "\" & $sFindNext
            EndIf
        WEnd

        FileClose($hSearch)

        StringReplace($aPathesArr[$aPathesArr[0]], "\", "")
        If @extended - $iLevel_Slashes = $iLevel Then ExitLoop
    Wend

    If $iMode = 1 Then
        Local $aTmp_Arr = $aPathesArr
        Local $iTmp_Count = 0

        For $i = 1 To $aPathesArr[0]
            If StringInStr(FileGetAttrib($aPathesArr[$i]), "D") Then ContinueLoop

            $iTmp_Count += 1
            $aTmp_Arr[$iTmp_Count] = $aPathesArr[$i]
        Next

        $aTmp_Arr[0] = $iTmp_Count
        ReDim $aTmp_Arr[$iTmp_Count+1]

        $aPathesArr = $aTmp_Arr
    EndIf

    Return $aPathesArr
EndFunc
Цитата Medic84:
А он и не подчеркивает »
Тогда зачем там соответствующая опция есть?

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community


Отправлено: 21:21, 29-06-2009 | #54