Newsletters Subscriptions Media Kit About Us Contact Search Home

mgo
OS/400 Edition
Volume 3, Number 64 -- September 24, 2003

FTP Directory Listing Options


Hey, Ted:

I just ran a DIR command in an FTP session with an iSeries server that I've never communicated with before, and the output doesn't look like what I'm accustomed to. The documentation mentions the namefmt option but really doesn't tell me much. How do I get a Unix-style directory listing?

--John


The format of the directory listing depends on two options: name format and list format. If you have some control over the iSeries server, you can change these options with the Change FTP Attributes (CHGFTPA) command. Whether you have any say is immaterial, however, because you can change these attributes within an FTP session or script.

You have two choices for the name format. The first, name format 0, is applicable only to files in the library system. Here is its format:

library/file.member

The alternative, name format 1, uses a directory-like syntax and is allowed for files in any file system. OS/400 IFS files are displayed in a Unix-like format, with directories separated with slashes (/). Library files have the following format:

/QSYS.LIB/library.LIB/file.FILE/member.MBR

Here's how member MYCLPGM in source physical file QGPL/QCLSRC would appear in the two name formats.

QGPL/QCLSRC.MYCLPGM

/QSYS.LIB/QGPL.LIB/QCLSRC.FILE/MYCLPGM.MBR

There are also two versions of the list format: 0 and 1. The documentation for the DIR command won't help you here; instead, see the documentation for the SITE server command.

List format 0, the traditional iSeries format, displays owner, size, date, time, type, and name.

SMITH            3544 07/26/03 16:44:33 *STMF      met.bak
SMITH              23 07/26/03 17:14:23 *STMF      names.txt
SMITH              13 08/06/03 11:51:52 *STMF      countx.awk
SMITH             104 03/18/02 05:48:43 *STMF      devnull.qsh
SMITH             116 08/18/03 05:52:37 *STMF      devnull2.qsh
SMITH           53248 08/18/03 06:04:47 *DIR       backup/
SMITH               8 08/18/03 05:51:07 *STMF      ediinput

List format 1 displays directory information in a Unix-like format. Fields are mode, number of links, owner, group, size, date/time, and file name.

-rwx------   1 SMITH    0           3544 Jul 26 16:44 met.bak
-rw-rw-rw-   1 SMITH    0             23 Jul 26 17:14 names.txt
-rw-rw-rw-   1 SMITH    0             13 Aug 06 11:51 countx.awk
-rwxrwxrwx   1 SMITH    0            104 Apr 03 2002  devnull.qsh
-rwxrwxrwx   1 SMITH    0            116 Aug 18 05:52 devnull2.qsh
drwxrwxrwx   2 SMITH    0          53248 Aug 18 06:04 backup
-rw-rw-rw-   1 SMITH    0              8 Aug 18 05:51 ediinput

From your question, it seems you want list format 1 and name format 1. To set these options, use the SITE server command in your session or script. (A server command is a command that runs on the FTP server, not on the FTP client.)

If you are using the OS/400 FTP client, include the following commands.

site namefmt 1
site listfmt 1

If you are using a client on a PC, you will probably have to execute SITE within the quote client command.

quote site namefmt 1
quote site listfmt 1

--Ted


Sponsored By
PROFOUND LOGIC SOFTWARE

RPGsp users don't settle for less!

Why settle for a tool that's just an application builder, or just a server, or just a designer, or just a green-screen converter?

You need an integrated Web development tool that can do all of the above. And you need the best!

RPGsp has what you need. Don't settle for less.

Free trial and information at www.RPGsp.com


THIS ISSUE
SPONSORED BY:

Damon Technologies
Profound Logic Software


BACK ISSUES

TABLE OF
CONTENTS

Date and Time Formats and Query/400

FTP Directory Listing Options

Reader Feedback and Insights: Here Comes Another One-Row, One-Column Table


Editors
Howard Arner
Joe Hertvik
Ted Holt
David Morris
Shannon O'Donnell

Managing Editor
Shannon Pastore

Publisher and
Advertising Director:

Jenny Thomas

Advertising Sales Representative
Kim Reed

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.