News for hackers. Stuff that matters.
Re:The Earliest Unix Code: An Anniversary Source Code Release by kps on Friday October 18, 2019 @12:39AM (#21288735)
I think you're right. My C-ish translation (that ignores errors) is:

    int dst /*8*/, src /*9*/, c1, df, tbuf[8], dir[BIG];
    char dotdot[] = "..      ";

    df = open(dotdot, O_RDONLY);
    dst = dir - 1;
    while (read(df, tbuf, 8) != 0) {
      if (tbuf[0] != 0) {
        c1 = -8;
        src = tbuf - 1;
        do {
          *++dst = *++src;
        } while (++c1 != 0);
      }
    }
    close(df);

    df = creat(dotdot);
    write(df, dir, dst - dir + 1);
    close(df);
    exit();
That is, copy any directory entry with a non-zero inode into dir[], and then write that back. Pack Directory.

According to https://wiki.tuhs.org/doku.php?id=systems:pdp7_unix ‘..’ was the name of the current directory (i.e. what is now ‘.’), so this operated on the current directory.

There are no comments on this comment yet.