From owner-freebsd-bugs Tue Oct 10 8:20: 8 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9846937B502 for ; Tue, 10 Oct 2000 08:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA56214; Tue, 10 Oct 2000 08:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Tue, 10 Oct 2000 08:20:01 -0700 (PDT) Message-Id: <200010101520.IAA56214@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Johan Karlsson Subject: Re: Fwd: Re: bin/21789: no mkfile command Reply-To: Johan Karlsson Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/21789; it has been noted by GNATS. From: Johan Karlsson To: Cc: Jim Pirzyk , FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: Fwd: Re: bin/21789: no mkfile command Date: Tue, 10 Oct 2000 17:18:10 +0200 At Mon, 09 Oct 2000 23:01:19 +0200, Johan Karlsson wrote: > This functionality is provided by the truncate(1) command. > Okey I know it is not exatly the same but I think its close enough. > I just managed to send an old version of the man page, it should be this on. Does this command solve your task that you need mkfile for? TRUNCATE(1) FreeBSD General Commands Manual TRUNCATE(1) NAME truncate - truncate or extend the length of files SYNOPSIS truncate [-c] -s [+|-]size[K|M|G] file ... truncate [-c] -r rfile file ... DESCRIPTION The truncate utility adjusts the length of each regular file given on the command-line. The following options are available: -c Do not create files if they do not exist. The truncate utility does not treat this as an error. No error messages are displayed and the exit value is not affected. -r rfile Truncate files to the length of the file rfile. -s [+|-]size[K|M|G] If the size argument is preceded by a plus sign (`+'), files will be extended by this number of bytes. If the size argument is preceded by a dash (`-'), file lengths will be reduced by no more than this number of bytes, to a minimum length of zero bytes. Otherwise, the size argument specifies an absolute length to which all files should be extended or reduced as appropriate. The size argument may be suffixed with one of `K', `M', `G' to indicate a multiple of Kilobytes, Megabytes or Gigabytes respec- tively. Exactly one of the -r and -s options must be specified. If a file is made smaller, its extra data is lost. If a file is made larger, it will be extended as if by writing bytes with the value zero. If the file does not exist, it is created unless the -c option is speci- fied. Note that, while truncating a file causes space on disk to be freed, ex- tending a file does not cause space to be allocated. To extend a file and actually allocate the space, it is necessary to explicitly write data to it, using (for example) the shell's `>>' redirection syntax, or dd(1). DIAGNOSTICS The truncate utility exits 0 on success, and >0 if an error occurs. If the operation fails for an argument, truncate will issue a diagnostic and continue processing the remaining arguments. SEE ALSO dd(1), touch(1), truncate(2) STANDARDS The truncate utility conforms to no known standards. HISTORY The truncate utility first appeared in FreeBSD 4.2. AUTHORS The truncate utility and this manual page were written by Sheldon Hearn . To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message