Re:The Earliest Unix Code: An Anniversary Source Code Release
by Pete_D on Thursday October 17, 2019 @07:09PM
(#21287199)
> Maybe ‘pd’ is something like ‘prepare directory’, constructing the dd/dotdot entry.
I think this is on the right track - it looks like the write call is to the newly created .., with df being used to hold the file descriptor.
Re:The Earliest Unix Code: An Anniversary Source Code Release
by kazinator on Thursday October 17, 2019 @07:25PM
(#21287284)
But the program appears to fail if dotdot can't be opened for reading, and it appears to scan through it doing reads first. Then it closes and does a creat, which is expected to succeed also. I'm suspecting that at this stage of development, open may have been used for reading and creat for writing (including to an existing file).
Re:The Earliest Unix Code: An Anniversary Source Code Release
by kps on Thursday October 17, 2019 @10:45PM
(#21288220)
From TFS¹, creat() on an existing file truncates it (i.e. to length zero, as O_TRUNC), and only the superuser can do this to a directory. open() has read/write flag bits as now.
I am leaning toward Pete_D's ‘pack directory’ idea.
¹ https://github.com/DoctorWkt/pdp7-unix/blob/e94417092a2980e7...
I think ‘dotdot’ is what is called ‘dd’ there (the corresponding symbol in ls is still named ‘dd'). I don't think the concept of a parent directory existed yet. Maybe ‘pd’ is something like ‘prepare directory’, constructing the dd/dotdot entry.