summaryrefslogtreecommitdiff
path: root/src/tail.c
AgeCommit message (Collapse)Author
2007-07-23Update all copyright notices to use the newer form.Jim Meyering
2007-07-10Change "version 2" to "version 3" in all copyright notices.Jim Meyering
2007-05-03The following commands and options now support the standard sizePaul Eggert
suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y: head -c, head -n, od -j, od -N, od -S, split -b, split -C, tail -c, tail -n. * doc/coreutils.texi (od invocation, head invocation, tail invocation): Document support for new size suffixes. (head invocation, tail invocation): Document that -n uses the same suffixes as -c. (tail invocation): More-clearly document what leading "+" does. * src/head.c (usage, string_to_integer): Support new suffixes. * src/od.c (usage, main): Likewise. * src/split.c (usage, main): Likewise. * src/tail.c (usage, parse_options): Likewise. Prompted by a patch from Evan Hunt.
2007-03-28Help translators include translation team's web or email address.Jim Meyering
* src/system.h (emit_bug_reporting_address): New function. * src/base64.c: Use it rather than a literal printf. * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c: * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c: * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c: * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c: * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c: * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c: * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c: * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c: * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c: * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c: * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c: * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c: * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c: * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c: * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c: * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c: * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c: * src/who.c, src/whoami.c, src/yes.c: Likewise.
2006-12-27* src/tail.c (usage): Mention +N for --bytes and --lines.Jim Meyering
Suggestion from Evan Hunt.
2006-10-25* src/cat.c (infile): Add "const" to declaration.Jim Meyering
* src/csplit.c (prefix): Likewise. * src/printf.c (cfcc_msg): Likewise. * src/tail.c (valid_file_spec): Likewise. * src/cut.c (cut_file): Likewise, for a parameter. * src/expr.c (str_value): Likewise. * src/fold.c (fold_file): Likewise. * src/pr.c (init_header): Likewise. * src/dircolors.c (dc_parse_stream): Likewise, for a local. * src/tr.c (make_printable_str): Likewise. * src/nl.c (body_type, header_type, footer_type, current_type): (separator_str, build_type_arg, nl_file): Likewise, for many. * src/paste.c (main): Don't assign a read-only string to 'optarg'. * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2006-09-08tail now ignores the -f option if POSIXLY_CORRECT is set,Paul Eggert
no file operand is given, and standard input is any FIFO.
2006-08-29* bootstrap.conf (gnulib_modules): Add isapipe.Paul Eggert
* src/tail.c: Include isapipe.h. (IS_PIPE_LIKE_FILE_TYPE): Remove. (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as tailable, since this seems to be portable. (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
2006-07-01(main): With no operand, 'tail -f' now silently ignores the '-f'Paul Eggert
only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
2006-01-31(parse_options): Use a better diagnostic when someone uses a trailingPaul Eggert
numeric option in an invalid way.
2006-01-24(tail_forever): Don't exit-nonzero when an attemptJim Meyering
to put a regular file in O_NONBLOCK mode fails with EPERM. That happens on Linux when using tail -f on a file with the append-only attribute. Reported by Dean Gaudet. For details, see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
2006-01-05(ENOSYS) [!defined ENOSYS]: Don't define here.Jim Meyering
It's already defined in "system.h".
2006-01-02(parse_options): Change warning to say that --retryJim Meyering
is useful `mainly' (not `only') when following by name. Reported here: http://bugs.debian.org/273781
2005-12-03(long_options): Change the name of each undocumented, for-Jim Meyering
testing-only option to start with `-', so that it cannot render ambiguous any prefix it happens to share with some other option name.
2005-11-01(parse_obsolete_option): Implement fix for "tail -c 2 FILE".Paul Eggert
2005-10-15(parse_options): Remove --allow-missing option.Jim Meyering
You can use --retry instead.
2005-09-16Include stat-time.h, and use its functions instead of the obsoletePaul Eggert
TIMESPEC_NS macro.
2005-08-22(xwrite_stdout): Rename from xwrite. Remove always-equal-to-STDOUT_FILENOJim Meyering
parameter and associated assertion. Adjust all callers.
2005-07-11(tail_bytes, tail_lines, tail_file, main):Paul Eggert
Avoid setmode; use POSIX-specified routines instead.
2005-07-03Include fcntl--.h, not unistd-safer.h.Paul Eggert
(recheck, tail_file): Don't call fd_safer; no longer needed now that we include fcntl--.h.
2005-06-16Don't embed `this'-style quotes in format strings.Jim Meyering
Rather than this: error (..., "...`%s'...", arg); do this: error (..., "...%s...", quote (arg));
2005-05-14Update FSF postal mail address.Jim Meyering
2005-05-14Update FSF postal mail address.Jim Meyering
2005-04-26(parse_obsolete_option): Don't complain about -NUM.Paul Eggert
2005-04-11Include unistd-safer.h rather than fcntl-safer.h.Paul Eggert
(recheck, tail_file): Use fd_safer rather than open_safer.
2005-03-28(follow_mode_string): Use NULL, not `0'.Jim Meyering
2005-01-14The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.Jim Meyering
(IS_TAILABLE_FILE_TYPE): Adjust definition also to include sockets, since that's what you get when reading from a command-line- supplied pipe on Darwin 7.7. (IS_PIPE_LIKE_FILE_TYPE): Define. (main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO. This same change is also required on NetBSD/sparc-1.5. Reported by Adrian Bunk.
2004-12-04(tail_file): Set errnum to -1 if the initial "tail" failed.Paul Eggert
2004-09-28(usage): Clarify: --retry works only with --follow=name.Jim Meyering
Reported by Nik A. Melchior in http://bugs.debian.org/273781.
2004-09-23(parse_obsolete_option): Bring back supportPaul Eggert
for obsolete option followed by non-obsolete, or by more than one file. When obsolete, conform to SUSv2 rather than original POSIX 1003.2-1992, as SUSv2 corrected the case of "tail -c". Add support for the SUSv2 "b" modifier.
2004-09-21Remove unused "case 0".Paul Eggert
2004-09-10(parse_obsolete_option): Renamed fromPaul Eggert
parse_obsolescent_option, since the options are obsolete now. Remove bool *arg; just exit if there's an error. Revamp to follow POSIX 1003.2-1992 more precisely, to handle cases like "tail - file" and "tail -10 -- file" correctly when we are conforming to the older standard. (main): Adjust to this change.
2004-08-02(struct File_spec, reopen_inaccessible_files, count_lines,Paul Eggert
forever, from_start, print_headers, have_read_stdin, valid_file_spec, write_header, file_lines, pipe_lines, pipe_bytes, recheck, tail_forever, tail_bytes, tail_lines, tail, tail_file, parse_obsolescent_option, parse_options, main): Use bool for booleans. (struct File_spec, max_n_unchanged_stats_between_opens, parse_options): Use uintmax_t, not unsigned int or unsigned long int, for state counters. (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to make it a bit clearer.
2004-07-23Include fcntl-safer.h.Paul Eggert
(COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong). (COPY_A_BUFFER): New macro. (struct File_spec): New members mtime, mode, blocking. Remove member n_consecutive_size_changes. (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES, max_n_consecutive_size_changes_between_opens, MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove. (long_options, tail_forever, parse_options): Remove (non-)support for --max-consecutive-size-changes. (record_open_fd): New function. (recheck, tail_file): Use it. Don't assume that stdin is open. (dump_remainder): Add support for new COPY_A_BUFFER special value. Treat errno==EAGAIN like EOF, since it might be a nonblocking read. (recheck): New arg BLOCKING, specifying whether to use blocking reads. All uses changed. (n_live_files): Remove, replacing with... (any_live_files): New function. All uses changed. (tail_forever): Use nonblocking I/O unless we know that blocking I/O is safe; this avoids some hangs when reading from a fifo. Avoid invoking fstat or sleep when using blocking I/O. Do not check for changes to size if the file is not a regular file, as the size is undefined in that case. Check for changes to mtime or mode, too; this works for non-regular files. (tail_forever, main): Redo fflush strategy to work even when input is nonblocking. Don't use unbuffered output; just flush when needed.
2004-07-22(main): Ignore -f if no file operand is specifiedPaul Eggert
and standard input is a pipe.
2004-06-15(parse_obsolescent_option): Support multiple file operandsJim Meyering
even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
2004-05-06(main): Use xnmalloc, rather than xmalloc.Jim Meyering
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(usage): Don't bother normalizing exit status since the arg is already the correct exit status now.
2004-01-12(main): Warn about following stdin only when it's a tty.Jim Meyering
2004-01-04(main): Warn about following stdin.Jim Meyering
Fail when following by name but no names are specified.
2003-11-27Include "c-strtod.h".Jim Meyering
(parse_options): Update xstrtod call to include new argument, c_strtod.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-16(start_bytes): Rename local, remainder, to avoidJim Meyering
gcc's warning about shadowing a global.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-09-06(enum): Add ALLOW_MISSING_OPTION.Jim Meyering
(parse_options): Give a diagnostic for (but still accept) the deprecated --allow-missing option.
2003-09-05(pipe_lines, pipe_bytes): Don't assign 0 or SAFE_READ_ERROR to tmp->nbytes.Jim Meyering
(struct linebuffer, struct charbuffer): Change nbytes and nlines from unsigned int to size_t. unsigned int is safe (after the 2003-09-03 patch) but size_t is cleaner. (pipe_bytes): Likewise for local variable 'i', which was 'int'. Standardize on BUFSIZ as opposed to other macro names and values. (BUFSIZ) [!defined BUFSIZ]: Remove. stdio.h has always defined it, and other code already assumes it's defined.
2003-09-04(pipe_lines): Don't truncate return value from safe_read.Jim Meyering
2003-08-16(tail_lines): Fix a potential (but very hard to exercise)Jim Meyering
race condition bug. The bug would be triggered when tailing a file with file pointer not at beginning of file, and where the file was truncated to have a length of less than the initial offset at just the right moment (between the two lseek calls in this function).