Sparrowlord Posted June 2, 2007 Share Posted June 2, 2007 So, I searched the forums for a good 40 minutes and was unable to find a way to do this. All I'm trying to do is make a new folder on my FTP with 5 random numbers as the name for the new folder. Any suggestions of where I could look to find this? Link to comment Share on other sites More sharing options...
Glyph Posted June 2, 2007 Share Posted June 2, 2007 So, I searched the forums for a good 40 minutes and was unable to find a way to do this. All I'm trying to do is make a new folder on my FTP with 5 random numbers as the name for the new folder. Any suggestions of where I could look to find this?You could use tcp, and if it receives something like "makefolderwith5randonumbers" then it would create a file with a variable name that makes 5 random numbers , assuming it's your personal server. tolle indicium Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 You could use tcp, and if it receives something like "makefolderwith5randonumbers" then it would create a file with a variable name that makes 5 random numbers , assuming it's your personal server.Let me explain this a bit more. I have a dedicated server I rent and that is what I would like to create the new folder on. I use a lot of txt files. so im trying to make something that will back them up for me on my server. Link to comment Share on other sites More sharing options...
Gif Posted June 2, 2007 Share Posted June 2, 2007 (edited) You could use tcp, and if it receives something like "makefolderwith5randonumbers" then it would create a file with a variable name that makes 5 random numbers , assuming it's your personal server. something like $ran = Random (1,6) $recv = TCPRecv( $ConnectedSocket, 2048 ) if $recv = "makefolderrandom" then DirCreate ("path" &"/"& $ran) else GUICtrlSetData($edit,$recv) endif *missing variables add them also search forums for FTP.au3, there are a lot of FTP scripts;;; Edited June 2, 2007 by c4nm7 Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 something like $ran = Random (1,6) $recv = TCPRecv( $ConnectedSocket, 2048 ) if $recv = "makefolderrandom" then DirCreate ("path" &"/"& $ran) else GUICtrlSetData($edit,$recv) endif *missing variables add them also search forums for FTP.au3, there are a lot of FTP scripts;;; I dont quite understand that. What im trying to do is make a script so when I run it, it will make a random 5 letter name folder on my ftp and upload all the txt files in the folder "txt" on my desktop. o.O didnt know it was this confusing Link to comment Share on other sites More sharing options...
Glyph Posted June 2, 2007 Share Posted June 2, 2007 (edited) I dont quite understand that. What im trying to do is make a script so when I run it, it will make a random 5 letter name folder on my ftp and upload all the txt files in the folder "txt" on my desktop. o.O didnt know it was this confusing func _gotill5() $blah="Txt docnamehere" $i=0 do $i=$i+1 filecopy($blah,"c:\"&$blah&$i&".txt",1) until $i=5 endfunc screwed up a bit there..can be modified to be sent over tcp conenctions. Edited June 2, 2007 by backstabbed tolle indicium Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 This is getting super confusing =/ If I could just figure out how to make a new folder on my FTP I can do the rest Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 2, 2007 Share Posted June 2, 2007 Sparrowlord is not trying to make the random name, he is trying to create a directory on an FTP server. I don't know why FTP.au3 wouldn't cover that, have you got the latest version? Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 Sparrowlord is not trying to make the random name, he is trying to create a directory on an FTP server. I don't know why FTP.au3 wouldn't cover that, have you got the latest version? I looked at the FTP.au3 and this is what I found: ;=============================================================================== ; ; Function Name: _FTPMakeDir() ; Description: Makes an Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The file name to be deleted. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPMakeDir($l_FTPSession, $s_Remote) Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote) If @error OR $ai_FTPMakeDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPMakeDir[0] EndFunc;==> _FTPMakeDir() Dont understand that though Link to comment Share on other sites More sharing options...
Glyph Posted June 2, 2007 Share Posted June 2, 2007 I looked at the FTP.au3 and this is what I found: ;=============================================================================== ; ; Function Name: _FTPMakeDir() ; Description: Makes an Directory on an FTP server. ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The file name to be deleted. ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - 1 ; On Failure - 0 ; Author(s): Wouter van Kesteren ; ;=============================================================================== Func _FTPMakeDir($l_FTPSession, $s_Remote) Local $ai_FTPMakeDir = DllCall('wininet.dll', 'int', 'FtpCreateDirectory', 'long', $l_FTPSession, 'str', $s_Remote) If @error OR $ai_FTPMakeDir[0] = 0 Then SetError(-1) Return 0 EndIf Return $ai_FTPMakeDir[0] EndFunc;==> _FTPMakeDir() Dont understand that though _FTPMakeDir($l_FTPSession, $s_Remote) ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The file name to be deleted tolle indicium Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 _FTPMakeDir($l_FTPSession, $s_Remote) ; Parameter(s): $l_FTPSession - The Long from _FTPConnect() ; $s_Remote - The file name to be deleted I dont understand that one bit.. to connect I use $server = 'xxxxx.com' $username = 'xxxxxxx@xxxxxx.com' $pass = 'xxxx' $Open = _FTPOpen ('FTP') $Conn = _FTPConnect ($Open, $server, $username, $pass) $Ftpc = _FTPClose ($Open) Why is that so much easier to do than what is in the FTP.au3 ? Link to comment Share on other sites More sharing options...
Glyph Posted June 2, 2007 Share Posted June 2, 2007 (edited) never mind. Edited June 2, 2007 by backstabbed tolle indicium Link to comment Share on other sites More sharing options...
Gif Posted June 2, 2007 Share Posted June 2, 2007 !!!!!!! i dont have FTP.au3 , and i have installed both Au3Lib and AutoIt 3.2.4.9 (just installed them again to be sure) is it in the include folder? Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 !!!!!!! i dont have FTP.au3 , and i have installed both Au3Lib and AutoIt 3.2.4.9 (just installed them again to be sure)is it in the include folder?Yes, my FTP.au3 is in the include folder. Link to comment Share on other sites More sharing options...
Gif Posted June 2, 2007 Share Posted June 2, 2007 Yes, my FTP.au3 is in the include folder.can u please post it here so i can include it too? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 2, 2007 Moderators Share Posted June 2, 2007 can u please post it here so i can include it too?Search and Poof! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Sparrowlord Posted June 2, 2007 Author Share Posted June 2, 2007 Omg! $folder = 'testfolder' $makedir = _FTPMakeDir ($conn, $folder ) It was easy as that... im pissed now Link to comment Share on other sites More sharing options...
Gif Posted June 2, 2007 Share Posted June 2, 2007 Search and Poof!WTF? when i ask if FTP.au3 is in the included folder i meant if it comes along with autoit, and you RESPOND LIKE THIS??????????????? cause you have the most posts that means that you can insult anyone??????????????? and that's fair;;;;;;; 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