Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2002 15:18:24 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Cyrille Lefevre <cyrille.lefevre@laposte.net>
Cc:        Tony Finch <dot@dotat.at>, 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>
In-Reply-To: <20020727051224.GA7996@gits.dyndns.org>
References:  <20020726165021.C7551@chiark.greenend.org.uk> <20020727051224.GA7996@gits.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020727201824.GB16128>