utimes(2): changing the birth time

2010-05-12 Thread Knowledge Seeker
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?

Thanks in advance.


-- 
Knoseeker
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: utimes(2): changing the birth time

2010-05-12 Thread Gary Jennejohn
On Wed, 12 May 2010 17:53:38 +
Knowledge Seeker knosee...@googlemail.com 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
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org


Re: utimes(2): changing the birth time

2010-05-12 Thread pluknet
On 12 May 2010 22:38, Gary Jennejohn gljennj...@googlemail.com wrote:
 On Wed, 12 May 2010 17:53:38 +
 Knowledge Seeker knosee...@googlemail.com 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.


btw, there's a paper someone can find something interesting at.
http://www.usenix.org/events/bsdcon03/tech/full_papers/mckusick/mckusick_html/

-- 
wbr,
pluknet
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to freebsd-hackers-unsubscr...@freebsd.org