comparison scripts/@ftp/loadobj.m @ 17548:92541ff4cc3c

improve implementation of ftp object handles * urlwrite.cc (curl_handles): Delete class. (handles): Delete static variable. (ch_manager): New class. (make_handle_fraction): New function. (F__ftp_pwd__, F__ftp_cwd__, F__ftp_dir__, F__ftp_ascii__, F__ftp_binary__, F__ftp_mode__, F__ftp_delete__, F__ftp_rmdir__, F__ftp_mkdir__, F__ftp_rename__, F__ftp_mput__, F__ftp_mget__): Find curl object corresponding to given handle using ch_manager instead of looking in handles map. (F__ftp__): Return handle instead of accepting it as argument. Change all uses.
author John W. Eaton <jwe@octave.org>
date Wed, 02 Oct 2013 23:40:01 -0400
parents 1c89599167a6
children d63878346099
comparison
equal deleted inserted replaced
17547:e7a9be8fdd21 17548:92541ff4cc3c
19 function b = loadobj (a) 19 function b = loadobj (a)
20 b = a; 20 b = a;
21 if (isfield (b, "jobject")) 21 if (isfield (b, "jobject"))
22 b = rmfield (b, "jobject"); 22 b = rmfield (b, "jobject");
23 endif 23 endif
24 b.curlhandle = tmpnam ("ftp-"); 24 b.curlhandle = __ftp__ (b.host, b.username, b.password);
25 __ftp__ (b.curlhandle, b.host, b.username, b.password);
26 if (isfield (b, "dir")) 25 if (isfield (b, "dir"))
27 if (! isempty (b.dir)) 26 if (! isempty (b.dir))
28 __ftp_cwd__ (b.curlhandle, b.dir); 27 __ftp_cwd__ (b.curlhandle, b.dir);
29 endif 28 endif
30 b = rmfield (b, "dir"); 29 b = rmfield (b, "dir");