From: Ben Bacarisse on
Michael Vilain <vilain(a)NOspamcop.net> writes:

> In article
> <0.67cbaf3facfbe723e6bf.20091205000921GMT.87vdgms2mm.fsf(a)bsb.me.uk>,
> Ben Bacarisse <ben.usenet(a)bsb.me.uk> wrote:
>
>> Bill Marcum <marcumbill(a)bellsouth.net> writes:
>>
>> > On 2009-12-03, Zinger <zmasood(a)gmail.com> wrote:
>> <snip>
>> >> I want to execute ls <filename> with a switch that should fetch all
>> >> files created with that name and are older than one day.
>> <snip>
>> > There is no creation time in Unix.
>>
>> Maybe not now, but there was. The original Unix stored a creation
>> time in a file's inode.
>
> [citation needed]

D M Ritchie, K Thompson, "The UNIX Time-Sharing System", The Bell
System Technical Journal, vol 57, no 6, part 2 (1978) pp. 1905-1929.

Specifically page 1914. This is the issue devoted, in its entirety,
to UNIX and C.

The earlier CACM paper (1974, vol 17 no 7?) is slightly different in
this respect. http://cm.bell-labs.com/cm/cs/who/dmr/cacm.html says
that the Bell Labs paper is a revision of the CACM paper.

This specific point seems to have a lot and even by V7, ls -c is
reporting the time of last change to the inode. V7 UNIX came out not
long after the 1978 paper (1979 I think). My memory is that pre-V7,
ls -c gave the creation time, but it was a long ago!

--
Ben.
From: Ben Bacarisse on
Ben Bacarisse <ben.usenet(a)bsb.me.uk> writes:

> Michael Vilain <vilain(a)NOspamcop.net> writes:
<snip>
>> [citation needed]
>
> D M Ritchie, K Thompson, "The UNIX Time-Sharing System", The Bell
> System Technical Journal, vol 57, no 6, part 2 (1978) pp. 1905-1929.
>
> Specifically page 1914. This is the issue devoted, in its entirety,
> to UNIX and C.
>
> The earlier CACM paper (1974, vol 17 no 7?) is slightly different in
> this respect. http://cm.bell-labs.com/cm/cs/who/dmr/cacm.html says
> that the Bell Labs paper is a revision of the CACM paper.
>
> This specific point seems to have a lot and even by V7, ls -c is
> reporting the time of last change to the inode. V7 UNIX came out not
> long after the 1978 paper (1979 I think). My memory is that pre-V7,
> ls -c gave the creation time, but it was a long ago!

I've found an old V6 manual (1974) and this suggest my memory of ls is
wrong. V6 stored two times in the inode (again different to the
description in the CACM paper) but creation time was not one of them.
V6 ls had no -c flag.

--
Ben.
From: Kaz Kylheku on
On 2009-12-05, Michael Vilain <vilain(a)NOspamcop.net> wrote:
> In article
><0.67cbaf3facfbe723e6bf.20091205000921GMT.87vdgms2mm.fsf(a)bsb.me.uk>,
> Ben Bacarisse <ben.usenet(a)bsb.me.uk> wrote:
>
>> Bill Marcum <marcumbill(a)bellsouth.net> writes:
>>
>> > On 2009-12-03, Zinger <zmasood(a)gmail.com> wrote:
>> <snip>
>> >> I want to execute ls <filename> with a switch that should fetch all
>> >> files created with that name and are older than one day.
>> <snip>
>> > There is no creation time in Unix.
>>
>> Maybe not now, but there was. The original Unix stored a creation
>> time in a file's inode.
>
> [citation needed]

The sources are now available online.

GIYF.
From: Kaz Kylheku on
On 2009-12-05, Kaz Kylheku <kkylheku(a)gmail.com> wrote:
> On 2009-12-05, Michael Vilain <vilain(a)NOspamcop.net> wrote:
>> In article
>><0.67cbaf3facfbe723e6bf.20091205000921GMT.87vdgms2mm.fsf(a)bsb.me.uk>,
>> Ben Bacarisse <ben.usenet(a)bsb.me.uk> wrote:
>>
>>> Bill Marcum <marcumbill(a)bellsouth.net> writes:
>>>
>>> > On 2009-12-03, Zinger <zmasood(a)gmail.com> wrote:
>>> <snip>
>>> >> I want to execute ls <filename> with a switch that should fetch all
>>> >> files created with that name and are older than one day.
>>> <snip>
>>> > There is no creation time in Unix.
>>>
>>> Maybe not now, but there was. The original Unix stored a creation
>>> time in a file's inode.
>>
>> [citation needed]
>
> The sources are now available online.
>
> GIYF.

Version 6 Unix ino structure, from 1975:

/*
* Inode structure as it appears on
* the disk. Not used by the system,
* but by things like check, df, dump.
*/
struct inode
{
int i_mode;
char i_nlink;
char i_uid;
char i_gid;
char i_size0;
char *i_size1;
int i_addr[8];
int i_atime[2];
int i_mtime[2];
};

Already no creation time at this point.


Description of stat from Version 4 stat man page,
1973.

..th STAT II 8/5/73
..sh NAME
stat \*- get file status
..sh SYNOPSIS

[ .. snip .. ]

After
..it stat,
..it buf
has the following structure (starting offset given in bytes):
..s3
..if t .ta .5 1i 2.5i
..if n .ta 3 9 24
..nf
struct {
char minor; /* +0: minor device of i-node */
char major; /* +1: major device */
int inumber /* +2 */
int flags; /* +4: see below */
char nlinks; /* +6: number of links to file */
char uid; /* +7: user ID of owner */
char gid; /* +8: group ID of owner */
char size0; /* +9: high byte of 24-bit size */
int size1; /* +10: low word of 24-bit size */
int addr[8]; /* +12: block numbers or device number */
int actime[2]; /* +28: time of last access */
int modtime[2]; /* +32: time of last modification */
};
..fi


No creation time. We have to dig back farther!

Indeed, the V3 Unix man page describes creation time.

..pa 1
..he 'STAT (II)'3/15/72'STAT (II)'

[ ... ]

after stat^H^H^H^H____, buf^H^H^H___ has the following format:
..sp
..nf
buf, +1 i-number
..br
+2,+3 flags (see below)
..br
+4 number of links
..br
+5 user ID of owner
..br
+6,+7 size in bytes
..br
+8,+9 first indirect block or contents block
..br
..li
....
..br
+22,+23 eighth indirect block or contents block
..br
+24,+25,+26,+27 creation time
..br
+28,+29,+30,+31 modification time
..br
+32,+33 unused
..fi

Bingo.

The source code has been lost; no ``struct ino'' for us.

Now we know why the structure argument is called ``buf''. It really was just a
buffer addressed by offsets once, with no struct type.
From: Ben Bacarisse on
Kaz Kylheku <kkylheku(a)gmail.com> writes:

> On 2009-12-05, Kaz Kylheku <kkylheku(a)gmail.com> wrote:
>> On 2009-12-05, Michael Vilain <vilain(a)NOspamcop.net> wrote:
>>> In article
>>><0.67cbaf3facfbe723e6bf.20091205000921GMT.87vdgms2mm.fsf(a)bsb.me.uk>,
>>> Ben Bacarisse <ben.usenet(a)bsb.me.uk> wrote:
>>>
>>>> Bill Marcum <marcumbill(a)bellsouth.net> writes:
>>>>
>>>> > On 2009-12-03, Zinger <zmasood(a)gmail.com> wrote:
>>>> <snip>
>>>> >> I want to execute ls <filename> with a switch that should fetch all
>>>> >> files created with that name and are older than one day.
>>>> <snip>
>>>> > There is no creation time in Unix.
>>>>
>>>> Maybe not now, but there was. The original Unix stored a creation
>>>> time in a file's inode.
>>>
>>> [citation needed]
>>
>> The sources are now available online.
>>
>> GIYF.
>
> Version 6 Unix ino structure, from 1975:
<snip>
> Already no creation time at this point.
>
>
> Description of stat from Version 4 stat man page,
> 1973.
<snip>
> No creation time. We have to dig back farther!
>
> Indeed, the V3 Unix man page describes creation time.
<snip>
> +24,+25,+26,+27 creation time
<snip>
> Bingo.

That's interesting but it does not square with the published papers.
The 1974 CACM paper has no creation time, but by 1978 that paper had
been revised for publication in the internal Bell Labs journal and an
inode had acquired a creation time.

Sources trump papers, of course, but it is certainly curious.

Another oddity is that I could swear to using a UNIX with a file
creation time. I am certain I never used V3 UNIX (my first use was
in 1978 just before V7 came out) so I wonder if I am fantasising. Did
early BSD have one? Did System III re-introduce it?

<snip>
--
Ben.
First  |  Prev  |  Next  |  Last
Pages: 1 2 3 4 5
Prev: Strip path to get filename
Next: touch to strip extension.