-- Functions for Server
ccftp.runServer(hostname, [disable-autoloop], [FTP-share], [account-directory]) -- runs the FTP-Server with the Hostname 'hostname'; WARNING! Do not set / as FTP-Share! Bad minded people could use this to crash the FTP-Server
if disable-autoloop is set to true, it will return 5 vars: first tells you if the request was successfull, second tells you who sent the request, third tells you with which account the request was sent, fourth tells you what was requested, the last one tells you additional args on success and error code when not
if no modem is attached it returns nMa; if no hostname is specified it returns nHn
ccftp.getRunningHost()
returns true and currently running host if there is one
returns just false if there is no currently running host
ccftp.closeServer()
returns true if there was still a running host which is now disabled
returns false if there is not any running host on the system
ccftp.createUser(Username, Password, [account-directory]) -- creates a User with the Name 'Username' and the Password 'Password'
returns on success true
returns on fail: nUsrN (no UserName), nUsrP (no Password), UsrE (User already exists)
ccftp.renameUser(oldUsername, newUsername, Password, [account-directory]) -- renames User 'oldUsername' to 'newUsername'; Password is needed for securety
returns on success true
returns on fail: noUsrN (no oldUserName), nnUsrN (no newUserName), nUsrP (no Password), nsUsr (oldUser does not exist), nUsrE (new User does exist), pww (password wrong)
ccftp.changeUserPass(Username, oldPassword, newPassword, [account-directory]) -- changes the Password from 'Username'
returns on success true
returns on fail: nUsrN (no UserName), noUsrP (no old password), nnUsrP (no new password), nsUsr (User does not exist), pww (password wrong)
ccftp.removeUser(Username, Password, [account-directory]) -- delete the specified User
returns on success true
returns on fail: nUsrN (no UserName), nUsrP (no Password), nsUsr (User does not exist), pww (password wrong)
-- Functions for Clients
ccftp.getClientVer()
returns current local API Version (can also be used on a ccFTP Server) (implemeted in Rev2)
ccftp.getServerVer(Hostname)
returns on success current API Version of the Server 'Hostname'
returns on fail: nMa (no modem attached), nsh (no such host) (also returns if sent to Rev1 Server)
ccftp.getDirCont(Hostname, Username, Password, [Subdir]) -- gets the contents of the directory 'Subdir' in the Share; if Subdir is left empty, it gets the contents of the Share-root; this is the only unencrypted communication
returns on success 2 tabels, first is all files of the FTP-Share Subdir, second is all folders in the FTP-Share Subdir
returns on fail: nsh (no such host), ddne (dir does not exist), pww (password wrong), nsu (no such user), nMa (no modem attached); wSV (Server runs a older API version); wCV (client runs a older API version)
ccftp.getFile(Hostname, Username, Password, FileonHost, FileonClient) -- downloads the File form Server to 'FileonClient'
returns on success true
returns on fail: nsh (no such host), fdne (file does not exist), pww (password wrong), nsu (no such user), nMa (no modem attached); wSV (Server runs a older API version); wCV (client runs a older API version)
ccftp.pushFile(Hostname, Username, Password, FileonClient, FileonHost) -- uploads the 'FileonClient' to the Server with name 'FileonHost'
returns on success true
returns on fail: nsh (no such host), pww (password wrong), nsu (no such user), nMa (no modem attached); wSV (Server runs a older API version); wCV (client runs a older API version)
ccftp.removeFile(Hostname, Username, Password, FileonHost)
returns on success true
returns on fail: nsh (no such host), fdne (file does not exist), pww (password wrong), nsu (no such user), nMa (no modem attached); wSV (Server runs a older API version); wCV (client runs a older API version)