DISP Display method for the SFTP object. Syntax: DISP(H) Description: DISP(H) displays an SFTP object as text. Examples: disp(h) See also: SFTP Authors: Joan Pau Beltran <joanpau.beltran@socib.cat>
0001 function disp(h) 0002 % DISP Display method for the SFTP object. 0003 % 0004 % Syntax: 0005 % DISP(H) 0006 % 0007 % Description: 0008 % DISP(H) displays an SFTP object as text. 0009 % 0010 % Examples: 0011 % disp(h) 0012 % 0013 % See also: 0014 % SFTP 0015 % 0016 % Authors: 0017 % Joan Pau Beltran <joanpau.beltran@socib.cat> 0018 0019 if length(h) ~= 1 0020 % FTP array; Should work for empty case as well. 0021 s = size(h); 0022 str = sprintf('%dx',s); 0023 str(end) = []; 0024 fprintf('%s array of SFTP objects\n', str); 0025 else 0026 disp(sprintf( ... 0027 ' SFTP Object\n host: %s\n port: %s\n user: %s\n dir: %s\n', ... 0028 h.host, num2str(h.port), h.username, mexsftp('pwd', h.sftp_handle))); 0029 end