From owner-freebsd-chat@FreeBSD.ORG Thu Sep 13 15:05:11 2007 Return-Path: Delivered-To: freebsd-chat@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 428BE16A419 for ; Thu, 13 Sep 2007 15:05:11 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.freebsd.org (Postfix) with ESMTP id 6548D13C474 for ; Thu, 13 Sep 2007 15:05:09 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.1/8.14.1) with ESMTP id l8DF3kn0039469; Thu, 13 Sep 2007 17:03:53 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.1/8.14.1/Submit) id l8DF3k8N039468; Thu, 13 Sep 2007 17:03:46 +0200 (CEST) (envelope-from olli) Date: Thu, 13 Sep 2007 17:03:46 +0200 (CEST) Message-Id: <200709131503.l8DF3k8N039468@lurza.secnetix.de> From: Oliver Fromme To: freebsd-chat@FreeBSD.ORG, deeptech71@gmail.com In-Reply-To: <46E94037.9070807@gmail.com> X-Newsgroups: list.freebsd-chat User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.2-STABLE-20070808 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 13 Sep 2007 17:03:54 +0200 (CEST) Cc: Subject: Re: filesystem timestamps and their usage X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-chat@FreeBSD.ORG, deeptech71@gmail.com List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Sep 2007 15:05:11 -0000 deeptech71@gmail.com wrote: > I know that every stuff like this is different here and there, and > actually the topic should have been named something like "let's make > a filesystem, what timestamps would you recommend?". I've already > looked up information about the UFS times (didn't know what birthtime > is though). But thanks anyway. What surprized me is that these are > standardized. Of course they are. After all, the "U" in UFS means UNIX. And how do you think NFS would work across different systems if time stamp semantics weren't standardized? > How do you detect UFS hard links from a program? What do you mean, exactly? Every file is an inode, and every directory entry (file name) is a hard link to an inode. An inode can have zero, one, or more names (hard links) within a file system. So, asking how to "detect hard links" does not make sense. Do you mean how to find the number of hard links of an inode? That's stored in the st_nlink value when you perform a stat(2), lstat(2) or fstat(2) syscall. > Do these "virtual files" have the same birth time? Hard links are not "virtual files". A hard link is a directory entry that points to an inode. There is nothing virtual about it. All properties ("meta data") of a file are stored in the inode. That includes owner, permissions, flags, and all the time stamps, including the birth time. A directory entry is just a name (character string) and a pointer to the inode. So if you have multiple entries (hard links) pointing to the same inode, they point to the same meta data. In other words, multiple hard links of the same inode cannot have different time stamps, permissions, owner etc. You can easily test it yourself: $ date; touch a; sleep 10; date; ln a b; ls -liTU a b Thu Sep 13 17:02:49 CEST 2007 Thu Sep 13 17:02:59 CEST 2007 3651805 -rw------- 2 olli olli 0 Sep 13 17:02:49 2007 a 3651805 -rw------- 2 olli olli 0 Sep 13 17:02:49 2007 b $ Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd Passwords are like underwear. You don't share them, you don't hang them on your monitor or under your keyboard, you don't email them, or put them on a web site, and you must change them very often.