Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
REBOL 1.42 KB | None | 0 0
  1. REBOL[
  2.     auteur: "Jardin_Zen"
  3.     nom: "FTPBase"
  4.     version: 0.1
  5. ]
  6.  
  7. system/schemes/ftp/passive: true
  8.  
  9. FtpBase: make object![
  10.     user:           none
  11.     password:       none
  12.     hote:           none
  13.     ftp:            none
  14.     filesOnServer:  none
  15.     command:        none ;
  16.     margin:         "     "
  17.     route:          none ;
  18.    
  19.     connect: make function! [user password hote][
  20.    
  21.         user:       ask "     Nom d'utilisation >>>"
  22.         password:   ask "     Mot de passe >>>"
  23.         hote:       ask "     Nom d'hote >>>"
  24.        
  25.         ftp: ftp://u58397286:240889@s326359202.onlinehome.fr/3Dleaf/
  26.        
  27.     ]
  28.    
  29.     dir: make function! [][                        
  30.    
  31.         foreach file read %. [
  32.             info: info? file
  33.             print [margin file margin info/size margin info/date margin info/type]
  34.             route: file  
  35.         ]                                      
  36.        
  37.     ]
  38.    
  39.     list: make function! [][
  40.         ; listing files on ftp
  41.         foreach file read ftp [
  42.             info: info? file
  43.             print [margin file]
  44.         ]
  45.        
  46.     ]
  47.    
  48.     upload: make function! [fichier][
  49.    
  50.         print fichier.
  51.    
  52.     ]
  53.  
  54. ]
  55.  
  56. jardinZen: make FtpBase[
  57.        
  58.     while [command != "exit"][
  59.        
  60.         command:  ask ">>>"
  61.            
  62.     liste: parse command none
  63.         command: first liste
  64.            
  65.         switch/default liste/1 [
  66.         "connect" [
  67.             connect user password hote
  68.         ]
  69.         "dir" [
  70.             dir
  71.         ]
  72.         "list" [
  73.             list
  74.         ]
  75.         "road" [
  76.             print what-dir
  77.         ]
  78.         "upload" [
  79.             upload liste/1
  80.         ]
  81.     ][ ]
  82.                          
  83.     ]
  84.    
  85. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement