From owner-freebsd-hackers@FreeBSD.ORG Wed May 12 18:38:29 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12A9D106566C for ; Wed, 12 May 2010 18:38:29 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8A8278FC0A for ; Wed, 12 May 2010 18:38:28 +0000 (UTC) Received: by fxm1 with SMTP id 1so440334fxm.13 for ; Wed, 12 May 2010 11:38:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=p5ut7tndTo1Ut854W1GWJFpptFr27ZVFTnZWkUlahv0=; b=qA1pNHcN6ErO53b3CLoHU21fyAknfgQiCJWzcHsjaq6idbGLcBasvRkuiOp8zcDlXo aWXP+dUDSIP5UaecxKV6seJ6oTQlNXY/VUCGNNjxznBvJjpopDwCPaaxMomAWK4cU5QU eKfDf9zeKkPeoJxYY53Z00xr1bCJENpnzdPW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=QYkvjnUFAugIHeYtVeyOczk+k+y+MH6CoYfhk6QLOlFu4Vj0YzoQaEPhJTzEI3XPnS DbKH+y5QdnjGq07yMCE7Bbl4Wa3UxpyZqxCccYhWzHL3sCUIl9mgGB3Tp9I6rnkSsA3p +qpM62uLvkES8ZA6vYplMKZbsQjFQQjlzlbbE= Received: by 10.223.72.156 with SMTP id m28mr8775145faj.26.1273689507603; Wed, 12 May 2010 11:38:27 -0700 (PDT) Received: from ernst.jennejohn.org (p57AE5487.dip.t-dialin.net [87.174.84.135]) by mx.google.com with ESMTPS id 13sm1890314fad.7.2010.05.12.11.38.26 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 12 May 2010 11:38:27 -0700 (PDT) Date: Wed, 12 May 2010 20:38:25 +0200 From: Gary Jennejohn To: Knowledge Seeker Message-ID: <20100512203825.1db158db@ernst.jennejohn.org> In-Reply-To: References: X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: utimes(2): changing the birth time X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 May 2010 18:38:29 -0000 On Wed, 12 May 2010 17:53:38 +0000 Knowledge Seeker wrote: > Hi, > Is there a way to set birth time to a value greater(newer) than the actual > birth time (not in the future, but not the current time)? > The man page utimes(2) says that is only possible to change to an older > value. > > I saw a way to do this by opening a new file, coping the data, setting the > other attributes, then calling utimes 2 times to set the birth and the > modification time. > > Is there a way to change it without creating a new file? > Not with the current code. vfs_syscalls.c:setutimes() explicitly checks that the new time is less than va_birthtime. Interestingly enough, there's code in the routine to handle what this comment in utimes(2) mentions, but it's not implemented yet. "Ideally a new system call will be added that allows the setting of all three times at once." -- Gary Jennejohn