From owner-freebsd-hackers Sat Jul 27 13:18:40 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7DAB137B400; Sat, 27 Jul 2002 13:18:36 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC80243E65; Sat, 27 Jul 2002 13:18:34 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g6RKIOAw021178; Sat, 27 Jul 2002 15:18:24 -0500 (CDT) (envelope-from dan) Date: Sat, 27 Jul 2002 15:18:24 -0500 From: Dan Nelson To: Cyrille Lefevre Cc: Tony Finch , freebsd-hackers@FreeBSD.ORG, freebsd-ports@FreeBSD.ORG Subject: Re: sed -i has difficulty with read-only files Message-ID: <20020727201824.GB16128@dan.emsphone.com> References: <20020726165021.C7551@chiark.greenend.org.uk> <20020727051224.GA7996@gits.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020727051224.GA7996@gits.dyndns.org> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jul 27), Cyrille Lefevre said: > IMHO, both the old and the newer code are wrong. they should use > getenv("TMPDIR") if any and certainly not the current directory. > there is probably more room in ${TMPDIR:-/var/tmp} then in the > current directory. imagine that the current fs is nearly full... Don't you want to temp filename to be in exactly the same place as the original file, so the rename() swap will work? If the current fs is full, then sed -i will fail anyway. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message