anzacfalcon Posted September 12, 2009 Share Posted September 12, 2009 I am working on a program that will send a log (txt file) to my FTP everytime the file size raises by 100 bytes. This is what the code partially looks like for your guide: $file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" ) If $file >100 Then $server = "ftp5.nofeehost.com" ;ftp host $username = "*CENSORED*" ;Ftp user $pass = "*CENSORED*" ;Ftp password $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt') $Ftpc = _FTPClose($Open) EndIf As you's can see, at the moment the log is sent once the file reaches over 100 bytes. What i need is the mathematical formula/code that will keep checking the filesize rather than just once and send the log every time the file size raises by 100 bytes. Thanks for listening! Link to comment Share on other sites More sharing options...
Hawkwing Posted September 12, 2009 Share Posted September 12, 2009 $currentmaxsize While 1 $file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" ) If $file > $currentmaxsize Then $server = "ftp5.nofeehost.com" ;ftp host $username = "*CENSORED*" ;Ftp user $pass = "*CENSORED*" ;Ftp password $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt') $Ftpc = _FTPClose($Open) $currentmaxsize += 100 EndIf WEnd The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
anzacfalcon Posted September 12, 2009 Author Share Posted September 12, 2009 $currentmaxsize While 1 $file = FileGetSize( "C:\Program Files\AdobeComponents\results.txt" ) If $file > $currentmaxsize Then $server = "ftp5.nofeehost.com" ;ftp host $username = "*CENSORED*" ;Ftp user $pass = "*CENSORED*" ;Ftp password $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass) $Ftpp = _FtpPutFile($Conn, 'C:\Program Files\AdobeComponents\results.txt', 'log.txt') $Ftpc = _FTPClose($Open) $currentmaxsize += 100 EndIf WEnd Thank's so much bro xD Link to comment Share on other sites More sharing options...
anzacfalcon Posted September 15, 2009 Author Share Posted September 15, 2009 Thank's so much bro xDA few problem's, im already using a while statement for my main code simmiliar to a keylogger and i get a variable used before declare. Link to comment Share on other sites More sharing options...
Hawkwing Posted September 15, 2009 Share Posted September 15, 2009 Might it be because I accidentally put $currentmaxsize as the first line instead of $currentmaxsize = 100 The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
anzacfalcon Posted September 16, 2009 Author Share Posted September 16, 2009 Thats it! xD Link to comment Share on other sites More sharing options...
anzacfalcon Posted September 16, 2009 Author Share Posted September 16, 2009 (edited) Close but not exact. Who ever can help me finalize my project will be thanked. <Removed> Edited September 16, 2009 by Valik Code removed. Link to comment Share on other sites More sharing options...
Hawkwing Posted September 16, 2009 Share Posted September 16, 2009 Is it just me, or does that look a lot like a keylogger? Perhaps I should have excluded myself from this topic... The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again. Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 30, 2009 Author Share Posted November 30, 2009 Is it just me, or does that look a lot like a keylogger? Perhaps I should have excluded myself from this topic...Yes it was a keylogger but i code other thing's aswell now so still thank you for your help Hawking. 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