[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FTP objects
From: |
David Bateman |
Subject: |
Re: FTP objects |
Date: |
Tue, 01 Dec 2009 02:03:27 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Judd Storrs wrote:
| Anothe
I setup a local ftp server for testing (i.e. it will only work for me,
the firewalls won't let outsiders in).
hostname: cuneus.msbb.uc.edu
username: ftpuser
password: 12345
If I start matlab and run
fp = ftp('cuneus.msbb.uc.edu','ftpuser','12345') ;
save ftp.mat fp
dir(fp)
I get the expected file listing. If I then quit matlab and restart
load ftp.mat
dir(fp)
works and gives the same file listing.
Ok that is pretty conclusive.
I don't know if matlab provides the get accessor function for FTP
objects and so this might just fail. The only other way to see if matlab
stores the username/password is to read the ftp.m constructor and maybe
modify the display method.
Tab completion in the Matlab command window indicates that fp.password exists.
I didn't think you should be allowed to access the fields of the object
as a structure in this manner
struct(fp)
ans =
jobject: [1x1 org.apache.commons.net.ftp.FTPClient]
host: 'cuneus.msbb.uc.edu'
port: 21
username: 'ftpuser'
password: '12345'
remotePwd: [1x1 java.lang.StringBuffer]
type: [1x1 java.lang.StringBuffer]
I'm currently storing "host", "username", "password" and a key into an
array of CURL handles in the object itself. This curl handle is probably
equivalent to the jobject in matlab. The remote path I'm adding into the
object to store in the saveobj method and at the same time removing the
curl handle. I'm not storing the port of the type.
So it looks like the password is saved in plaintext.
Yes it does so I'll leave it at that.
I'm attaching
ftp.mat. It wouldn't load in octave because I didn't have a matching
constructor. I can't remember how to get around that but I think there
is a way.
Could I have a v6 version of this file.. The compression of a v7 format
makes the file difficult to read manually.. As for loading it into
Octave, I believe the only way to do it is to modify ls-mat5.cc so that
classes without constructors are treated as structures, or just disable
classes temporarily by setting "isclass=false" at the "case
MAT_FILE_STRUCT_CLASS" statement in the load function.
D.
--judd
--
David Bateman address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)