Jump to content

Dudka

Members
  • Posts

    7
  • Joined

  • Last visited

Everything posted by Dudka

  1. Check this out http://www.autoitscript.com/fileman/users/Zedna/ autodial_src.zip
  2. full file path solve the problem thx a lot #include "c:\.develope\AutoIT\.modules\Zip.au3" dim $zip=@ScriptDir&"\"&@ScriptName&" at "&@YEAR&"-"&@MON&"-"&@MDAY&" "&@HOUR&"_"&@MIN&"_"&@SEC&".zip" dim $zf=_Zip_Create($zip) _Zip_AddFile($zf,"C:\boot.ini",0)
  3. dim $zip=@ScriptName&" at "&@YEAR&"-"&@MON&"-"&@MDAY&" "&@HOUR&"_"&@MIN&"_"&@SEC&".zip"makes $zip like "test.au3 at 2008-11-11 15_41_42.zip" after that dim $zf=_Zip_Create($zip) succesfully creates such file as "test.au3 at 2008-11-11 15_41_42.zip" filesize 22 bytes go on
  4. #include "c:\.develope\AutoIT\.modules\Zip.au3" dim $zip=@ScriptName&" at "&@YEAR&"-"&@MON&"-"&@MDAY&" "&@HOUR&"_"&@MIN&"_"&@SEC&".zip" dim $zf=_Zip_Create($zip) _Zip_AddFile($zf,"C:\boot.ini") >"c:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\.develope\AutoMate\.Bank\Balances.staff\test.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>15:33:10 Starting AutoIt3Wrapper v.1.10.1.8 Environment(Language:0419 Keyboard:00000409 OS:WIN_XP/Service Pack 3 CPU:X86) >Running AU3Check (1.54.13.0) from:C:\Program Files\AutoIt3 +>15:33:10 AU3Check ended.rc:0 >Running:(3.2.12.0):C:\Program Files\AutoIt3\autoit3.exe "C:\.develope\AutoMate\.Bank\Balances.staff\test.au3" c:\.develope\AutoIT\.modules\Zip.au3 (302) : ==> Object referenced outside a "With" statement.: $hList = $oApp.Namespace($hZipFile).items $hList = $oApp.Namespace($hZipFile)^ ERROR ->15:33:10 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 1.896 it seems to me that problem is that code try to get files list from blank zip file
  5. thx a lot 4 help & patience i have solved my problem. The error was in pattern. as a $file_name i use full path like 'c:\boot.ini' so no results was returned. so working functuion is #Include <File.au3> #include <Array.au3> Func _FtpPutFile($server,$remotedir,$file_name,$user='anonymous',$password='mail@tome.com',$port='21') Dim $szDrive, $szDir, $szFName, $szExt $commandfilename=_TempFile() $resultsname=_TempFile() $handle=FileOpen($commandfilename,2) FileWriteLine($handle,"open "&$server&" "&$port) FileWriteLine($handle,$user) FileWriteLine($handle,$password) FileWriteLine($handle,"cd ."&$remotedir) FileWriteLine($handle,"binary") FileWriteLine($handle,"put "&$file_name) FileWriteLine($handle,"dir") FileWriteLine($handle,"bye") FileClose($handle) RunWait(@ComSpec & " /c ftp -s:" & $commandfilename & " >" & $resultsname, "", @SW_HIDE) FileDelete($commandfilename) $data=FileRead($resultsname) FileDelete($resultsname) $sp=_PathSplit($file_name,$szDrive, $szDir, $szFName, $szExt) $f_s=StringRegExp($data,"-r.?-r.?-r.?-.*"&$user&"\s*(\d+).*"&$sp[3]&$sp[4],3) ;~ _ArrayDisplay($f_s) Return $f_s[0]=FileGetSize($file_name) EndFunc
  6. Hm. Your example works fine. Yes, i know that array returns as the result. Cant's figure out whats wrong here #Include <File.au3> #include <Array.au3> Func _FtpPutFile($server,$remotedir,$file_name,$user='anonymous',$password='mail@tome.com',$port='21') $commandfilename=_TempFile() $resultsname=_TempFile() $handle=FileOpen($commandfilename,2) FileWriteLine($handle,"open "&$server&" "&$port) FileWriteLine($handle,$user) FileWriteLine($handle,$password) FileWriteLine($handle,"cd ."&$remotedir) FileWriteLine($handle,"binary") FileWriteLine($handle,"put "&$file_name) FileWriteLine($handle,"dir") FileWriteLine($handle,"bye") FileClose($handle) RunWait(@ComSpec & " /c ftp -s:" & $commandfilename & " >" & $resultsname, "", @SW_HIDE) FileDelete($commandfilename) $data=FileRead($resultsname) FileDelete($resultsname) $f_s=StringRegExp($data,"-r.?-r.?-r.?-.*"&$user&"\s*(\d+).*"&$file_name,3) ;~ _ArrayDisplay($f_s) Return $f_s[0]=FileGetSize($file_name) EndFunc
  7. Could anybody tell me why StringRegExp("[11]|-rw-r--r-- 1 ixb ixb 53295 Jun 18 18:39 1706.BAL","-r.?-r.?-r.?-.*ixb\s*(\d+).*1706.BAL",3) does not return any result? Javascript based regular expressions work fine with this example Whats with autoit?
×
×
  • Create New...