|
Packit Service |
f629e6 |
.TH READDIR 3am "Jan 15 2013" "Free Software Foundation" "GNU Awk Extension Modules"
|
|
Packit Service |
f629e6 |
.SH NAME
|
|
Packit Service |
f629e6 |
readdir \- directory input parser for gawk
|
|
Packit Service |
f629e6 |
.SH SYNOPSIS
|
|
Packit Service |
f629e6 |
.ft CW
|
|
Packit Service |
f629e6 |
@load "readdir"
|
|
Packit Service |
f629e6 |
.ft R
|
|
Packit Service |
f629e6 |
.SH DESCRIPTION
|
|
Packit Service |
f629e6 |
The
|
|
Packit Service |
f629e6 |
.I readdir
|
|
Packit Service |
f629e6 |
extension
|
|
Packit Service |
f629e6 |
adds an input parser for directories.
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
When this extension is in use, instead of skipping directories named
|
|
Packit Service |
f629e6 |
on the command line (or with
|
|
Packit Service |
f629e6 |
.BR getline ),
|
|
Packit Service |
f629e6 |
they are read, with each entry returned as a record.
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
The record consists of three fields. The first two are the inode number and the
|
|
Packit Service |
f629e6 |
filename, separated by a forward slash character.
|
|
Packit Service |
f629e6 |
On systems where the directory entry contains the file type, the record
|
|
Packit Service |
f629e6 |
has a third field which is a single letter indicating the type of the
|
|
Packit Service |
f629e6 |
file:
|
|
Packit Service |
f629e6 |
.B f
|
|
Packit Service |
f629e6 |
for file,
|
|
Packit Service |
f629e6 |
.B d
|
|
Packit Service |
f629e6 |
for directory,
|
|
Packit Service |
f629e6 |
.B b
|
|
Packit Service |
f629e6 |
for a block device,
|
|
Packit Service |
f629e6 |
.B c
|
|
Packit Service |
f629e6 |
for a character device,
|
|
Packit Service |
f629e6 |
.B p
|
|
Packit Service |
f629e6 |
for a FIFO,
|
|
Packit Service |
f629e6 |
.B l
|
|
Packit Service |
f629e6 |
for a symbolic link,
|
|
Packit Service |
f629e6 |
.B s
|
|
Packit Service |
f629e6 |
for a socket, and
|
|
Packit Service |
f629e6 |
.B u
|
|
Packit Service |
f629e6 |
(unknown) for anything else.
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
On systems without the file type information, the third field is always
|
|
Packit Service |
f629e6 |
.BR u .
|
|
Packit Service |
f629e6 |
.SH NOTES
|
|
Packit Service |
f629e6 |
On GNU/Linux systems, there are filesystems that don't support the
|
|
Packit Service |
f629e6 |
.B d_type
|
|
Packit Service |
f629e6 |
entry (see
|
|
Packit Service |
f629e6 |
.IR readdir (3)),
|
|
Packit Service |
f629e6 |
and so the file type is always
|
|
Packit Service |
f629e6 |
.BR u .
|
|
Packit Service |
f629e6 |
You can use the
|
|
Packit Service |
f629e6 |
.I filefuncs
|
|
Packit Service |
f629e6 |
extension to call
|
|
Packit Service |
f629e6 |
.I stat()
|
|
Packit Service |
f629e6 |
in order to get correct type information.
|
|
Packit Service |
f629e6 |
.\" .SH BUGS
|
|
Packit Service |
f629e6 |
.SH EXAMPLE
|
|
Packit Service |
f629e6 |
.ft CW
|
|
Packit Service |
f629e6 |
.nf
|
|
Packit Service |
f629e6 |
@load "readdir"
|
|
Packit Service |
f629e6 |
\&...
|
|
Packit Service |
f629e6 |
BEGIN { FS = "/" }
|
|
Packit Service |
f629e6 |
{ print "file name is", $2 }
|
|
Packit Service |
f629e6 |
.fi
|
|
Packit Service |
f629e6 |
.ft R
|
|
Packit Service |
f629e6 |
.SH "SEE ALSO"
|
|
Packit Service |
f629e6 |
.IR "GAWK: Effective AWK Programming" ,
|
|
Packit Service |
f629e6 |
.IR filefuncs (3am),
|
|
Packit Service |
f629e6 |
.IR fnmatch (3am),
|
|
Packit Service |
f629e6 |
.IR fork (3am),
|
|
Packit Service |
f629e6 |
.IR inplace (3am),
|
|
Packit Service |
f629e6 |
.IR ordchr (3am),
|
|
Packit Service |
f629e6 |
.IR readfile (3am),
|
|
Packit Service |
f629e6 |
.IR revoutput (3am),
|
|
Packit Service |
f629e6 |
.IR rwarray (3am),
|
|
Packit Service |
f629e6 |
.IR time (3am).
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
.IR opendir (3),
|
|
Packit Service |
f629e6 |
.IR readdir (3),
|
|
Packit Service |
f629e6 |
.IR stat (2).
|
|
Packit Service |
f629e6 |
.SH AUTHOR
|
|
Packit Service |
f629e6 |
Arnold Robbins,
|
|
Packit Service |
f629e6 |
.BR arnold@skeeve.com .
|
|
Packit Service |
f629e6 |
.SH COPYING PERMISSIONS
|
|
Packit Service |
f629e6 |
Copyright \(co 2012, 2013,
|
|
Packit Service |
f629e6 |
Free Software Foundation, Inc.
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
Permission is granted to make and distribute verbatim copies of
|
|
Packit Service |
f629e6 |
this manual page provided the copyright notice and this permission
|
|
Packit Service |
f629e6 |
notice are preserved on all copies.
|
|
Packit Service |
f629e6 |
.ig
|
|
Packit Service |
f629e6 |
Permission is granted to process this file through troff and print the
|
|
Packit Service |
f629e6 |
results, provided the printed document carries copying permission
|
|
Packit Service |
f629e6 |
notice identical to this one except for the removal of this paragraph
|
|
Packit Service |
f629e6 |
(this paragraph not being relevant to the printed manual page).
|
|
Packit Service |
f629e6 |
..
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
Permission is granted to copy and distribute modified versions of this
|
|
Packit Service |
f629e6 |
manual page under the conditions for verbatim copying, provided that
|
|
Packit Service |
f629e6 |
the entire resulting derived work is distributed under the terms of a
|
|
Packit Service |
f629e6 |
permission notice identical to this one.
|
|
Packit Service |
f629e6 |
.PP
|
|
Packit Service |
f629e6 |
Permission is granted to copy and distribute translations of this
|
|
Packit Service |
f629e6 |
manual page into another language, under the above conditions for
|
|
Packit Service |
f629e6 |
modified versions, except that this permission notice may be stated in
|
|
Packit Service |
f629e6 |
a translation approved by the Foundation.
|
|
Packit Service |
f629e6 |
.\" vim: set filetype=nroff :
|