4 ms·
unlink() could have come a lot later, or been at a different level of abstraction, etc. i'm really sure i read this, so i just made another attempt to find the
by allenbrunson 17y ago
unlink() could have come a lot later, or been at a different level of abstraction, etc.
i'm really sure i read this, so i just made another attempt to find the original source. the closest i could get was this man page for tmpnam:
"Many applications prefer their temporary files to have certain favorite initial letter sequences in their names. Use the pfx argument for this. This argument may be NULL or point to a string of up to five characters to be used as the first few characters of the temporary-file name."
http://www.phy.ohiou.edu/cgi-bin/man-cgi.sol?tmpnam+3S http://www.phy.ohiou.edu/cgi-bin/man-cgi.sol?tmpnam+3S
... which is a bit dubious, i admit, but just might point to a five-character file limit at one point in the murky past.
- jacquesm 17y agoIn some of the older version of the PDP assembler the symbols could be any length, but only the first 6 characters were significant, so you'd better make sure that your first 6 chars are unique. I don't see any reason to mix filenames and symbol length in any language though.
- allenbrunson 17y agothe one time i was poking around in the source files for the C standard library, the implementation for a given function was always in a similarly-named source file. printf() was in printf.c, and so on. so let's say you're implementing unix on a machine that has a five-character filename limit, and you want to follow that rule. creat.c is going to implement creat(). that would explain why he now thinks it's a mistake: he could have implemented create() in creat.c, but chose convention over forward-thinking.
- cpr 17y agoI'm pretty sure Unix even in its most primitive forms never had a 5-character filename limit. It might have been 8 initially, but not less than that.
- allenbrunson 17y agoyeah, i admit, i'm kind of reaching. i am sure i read a story about where the original limitation came from, i just can't remember the details. maybe it had something to do with kernel functions versus library functions? creat(), read(), write(), etc were all part of the early unix kernel, and were accessed via call gate or syscall or something, whereas printf() and friends were part of a library, and didn't require a trip into kernel-land, and therefore weren't under the same restrictions. something like that.
- cpr 17y agoYes, and I believe in early versions of Unix, system calls were prefixed by a _, so _creat was at the limit. (From vague memories of a pre-release version of Unix that showed up at Harvard in the mid-70's before it was even officially released to universities by Bell Labs.)