-.\" $File: file.man,v 1.79 2008/11/06 22:49:08 rrt Exp $
+.\" $File: file.man,v 1.80 2009/05/08 17:41:58 christos Exp $
.Dd October 9, 2008
.Dt FILE __CSECTION__
.Os
.Nd determine file type
.Sh SYNOPSIS
.Nm
-.Op Fl bchikLnNprsvz
-.Op Fl -mime-type
+.Bk -words
+.Op Fl bchikLNnprsvz
.Op Fl -mime-encoding
-.Op Fl f Ar namefile
+.Op Fl -mime-type
.Op Fl F Ar separator
+.Op Fl f Ar namefile
.Op Fl m Ar magicfiles
-.Ar file
+.Ar
+.Ek -words
.Nm
.Fl C
-.Op Fl m Ar magicfile
+.Op Fl m Ar magicfiles
.Nm
.Op Fl -help
.Sh DESCRIPTION
.Bl -tag -width indent
.It Fl b , -brief
Do not prepend filenames to output lines (brief mode).
+.It Fl C , -compile
+Write a
+.Pa magic.mgc
+output file that contains a pre-parsed version of the magic file or directory.
.It Fl c , -checking-printout
Cause a checking printout of the parsed form of the magic file.
This is usually used in conjunction with the
.Fl m
flag to debug a new magic file before installing it.
-.It Fl C , -compile
-Write a
-.Pa magic.mgc
-output file that contains a pre-parsed version of the magic file or directory.
.It Fl e , -exclude Ar testname
Exclude the test named in
.Ar testname
.It tar
Examines tar files.
.El
+.It Fl F , -separator Ar separator
+Use the specified string as the separator between the filename and the
+file result returned. Defaults to
+.Sq \&: .
.It Fl f , -files-from Ar namefile
Read the names of the files to be examined from
.Ar namefile
to test the standard input, use
.Sq -
as a filename argument.
-.It Fl F , -separator Ar separator
-Use the specified string as the separator between the filename and the
-file result returned. Defaults to
-.Sq \&: .
.It Fl h , -no-dereference
option causes symlinks not to be followed
(on systems that support symbolic links). This is the default if the
This is the default if the environment variable
.Dv POSIXLY_CORRECT
is defined.
-.It Fl m , -magic-file Ar list
+.It Fl m , -magic-file Ar magicfiles
Specify an alternate list of files and directories containing magic.
This can be a single item, or a colon-separated list.
If a compiled magic file is found alongside a file or directory, it will be used instead.
+.It Fl N , -no-pad
+Don't pad filenames so that they align in the output.
.It Fl n , -no-buffer
Force stdout to be flushed after checking each file.
This is only useful if checking a list of files.
It is intended to be used by programs that want filetype output from a pipe.
-.It Fl N , -no-pad
-Don't pad filenames so that they align in the output.
.It Fl p , -preserve-date
On systems that support
.Xr utime 2
#------------------------------------------------------------------------------
-# $File$
+# $File: audio,v 1.58 2009/09/19 16:28:08 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
>21 ubyte <128 note %d,
>22 byte =0 replay 5.485 KHz
>22 byte =1 replay 8.084 KHz
->22 byte =2 replay 10.971 Khz
->22 byte =3 replay 16.168 Khz
+>22 byte =2 replay 10.971 KHz
+>22 byte =3 replay 16.168 KHz
>22 byte =4 replay 21.942 KHz
>22 byte =5 replay 32.336 KHz
>22 byte =6 replay 43.885 KHz
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: file.c,v 1.132 2009/07/15 14:08:23 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.133 2009/09/14 17:50:38 christos Exp $")
#endif /* lint */
#include "magic.h"
#include "patchlevel.h"
#ifdef S_IFLNK
-#define SYMLINKFLAG "Lh"
+#define FILE_FLAGS "-bchikLNnrsvz0"
#else
-#define SYMLINKFLAG ""
+#define FILE_FLAGS "-bcikNnrsvz0"
#endif
-# define USAGE "Usage: %s [-bcik" SYMLINKFLAG "nNrsvz0] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...\n %s -C -m magicfiles\n"
+# define USAGE
+ "Usage: %s [" FILE_FLAGS \
+ "] [-e test] [-f namefile] [-F separator] [-m magicfiles] file...\n" \
+ " %s -C -m magicfiles\n" \
+ " %s [--help]\n"
#ifndef MAXPATHLEN
#define MAXPATHLEN 1024
private void
usage(void)
{
- (void)fprintf(stderr, USAGE, progname, progname);
- (void)fputs("Try `file --help' for more information.\n", stderr);
+ (void)fprintf(stderr, USAGE, progname, progname, progname);
exit(1);
}