Home > status  [2 examples]

Show current status on remote server.

 Examples

Ex. 1. Show status of server.
Ex. 2. Show status of directory.


Ex. 1.  Show status of server.
SET SERVEROUTPUT ON SIZE 1000000;
DECLARE
  fid VARCHAR2(80);
  host VARCHAR2(80)   := 'ftp.mcafee.com';
  usernm VARCHAR2(80) := 'anonymous';
  passwd VARCHAR2(80) := '';
BEGIN
  fid := fclient_p.createFTPClient;
  fclient_p.login(fid, host, usernm, passwd);

  fclient_p.status(fid);
  DBMS_OUTPUT.PUT_LINE(SUBSTR(REPLACE(fclient_p.getLastResponseString(fid), CHR(10)), 1, 255));

  fclient_p.logout(fid);
  fclient_p.remove(fid);
EXCEPTION
  WHEN fclient_p.java_failed THEN
    DBMS_OUTPUT.PUT_LINE(SUBSTR(fclient_p.getErrorWithResponse(fid), 1, 255));
END;
/

Output from above example: ftptest.tester.com FTP server status: Version wu-2.6.0(1) Mon Feb 28 10:30:36 EST 2000 Connected to 172.20.41.71 Logged in as tester TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: Stream No data conne


Ex. 2.  Show status of directory.
SET SERVEROUTPUT ON SIZE 1000000;
DECLARE
  fid VARCHAR2(80);
  host VARCHAR2(80)   := 'ftp.mcafee.com';
  usernm VARCHAR2(80) := 'anonymous';
  passwd VARCHAR2(80) := '';
BEGIN
  fid := fclient_p.createFTPClient;
  fclient_p.login(fid, host, usernm, passwd);

  fclient_p.status(fid, '/gnu/windows');
  DBMS_OUTPUT.PUT_LINE(SUBSTR(REPLACE(fclient_p.getLastResponseString(fid), CHR(10)), 1, 255));

  fclient_p.logout(fid);
  fclient_p.remove(fid);
EXCEPTION
  WHEN fclient_p.java_failed THEN
    DBMS_OUTPUT.PUT_LINE(SUBSTR(fclient_p.getErrorWithResponse(fid), 1, 255));
END;
/

Output from above example: status of /home/tester:total 450484-rw------- 1 tester tester 2720 Mar 25 10:11 .bash_history-rw-r--r-- 1 tester tester 24 Jan 21 12:24 .bash_logout-rw-r--r-- 1 tester tester 230 Jan 21 12:24 .bash_profil

 Related Commands
 
© 1999-2003 Bear Claw Inc.