On Thu, 11 Jun 1998, Doug Yowza <yowza(a)yowza.com> wrote:
] That used to be one of my interview questions for Unix programmers: your
] buggy program just created a filename with {control characters, leading
] dash (-), leading slash (/), '*', etc} in it. How do you delete it?
Oh shoot. And I thought I was Unix-competent.
I thought the only way to put a slash in a filename was with a
low-level filesystem hack. I mean, the OS calls themselves will
take "a/b" to mean file "b" in directory "a", right? It
isn't up
to your program to parse the filename that way. That isn't
something you can get get around, even with any ordinary sort of
bug. Is it?
Of course, given root permission, you could run the appropriate
disk utility, open /dev/root as a file, find the directory block,
and put anything you like in a filename. But then you would have
to do the same thing to access that file or get rid of it, wouldn't
you? How could 'rm' get around that?
ObCC: I just noticed /dev/drum on a Dec here. Now I *know* there
is not a drum on this thing, so this must be a holdover from some
earlier implementation of some Unix. True? Were filesystems on
drums managed the same as those on disks? I don't see any reason
why they wouldn't be, offhand. But I thought drums died out before
Unix appeared. Does anyone still have a functional magnetic drum
memory? That would be one _awesome_ peripheral. :-)
Bill.