Module: Ftpd::DiskFileSystem::List
- Includes:
- TranslateExceptions
- Included in:
- Ftpd::DiskFileSystem
- Defined in:
- lib/ftpd/disk_file_system.rb
Overview
DiskFileSystem mixin providing directory listing
Instance Method Summary collapse
-
#list(ftp_path) ⇒ Object
Get a file list, long form.
Methods included from TranslateExceptions
included, #translate_exception
Instance Method Details
#list(ftp_path) ⇒ Object
Get a file list, long form. This returns a long-form directory listing. The FTP standard does not specify the format of the listing, but many systems emit a *nix style directory listing:
-rw-r--r-- 1 wayne wayne 4 Feb 18 18:36 a
-rw-r--r-- 1 wayne wayne 8 Feb 18 18:36 b
some emit a Windows style listing. Some emit EPLF (Easily Parsed List Format):
+i8388621.48594,m825718503,r,s280, djb.html
+i8388621.50690,m824255907,/, 514
+i8388621.48598,m824253270,r,s612, 514.html
EPLF is a draft internet standard for the output of LIST:
http://cr.yp.to/ftp/list/eplf.html
Some FTP clients know how to parse EPLF; those clients will display the EPLF in a more user-friendly format. Clients that don’t recognize EPLF will display it raw. The advantages of EPLF are that it’s easier for clients to parse, and the client can display the LIST output in any format it likes.
This class emits a *nix style listing. It does so by shelling to the “ls” command, so it won’t run on Windows at all.
Called for:
-
LIST
If missing, then these commands are not supported.
276 277 278 |
# File 'lib/ftpd/disk_file_system.rb', line 276 def list(ftp_path) ls(ftp_path, '-l') end |