dal@midgard.Midgard.MN.ORG (Dale Schumacher) (05/09/89)
As mentioned in an earlier article, I'm working on developing mail/news software for Minix. In the process of looking at what code I could port from other sources (like dcp/uupc) and reading what little documentation I could find, I've run into a problem with the naming of work, data and execute files for mail. It seems that the schemes in common use and those documented in the Nutshell book "Managing UUCP and USENET" all have potential filename collision problems. A few methods are outlined below to show where I think the problems occur. In each case I show an outgoing job #1234 and an incomming job #9876. Our system name is 'system' the remote system is 'remote'. All paths are relative to /usr/spool/uucp. Nutshell docs: C.remoteA1234 -- uucico work file D.remot1234001 -- outgoing message D.remot1234002 -- remote execute file D.syste9876001 -- incomming message X.systemX9876 -- incomming execute file Example A: remote/C.remoteN1234 -- uucico work file remote/D.syste1234001 -- outgoing message remote/D.remot1234002 -- remote execute file remote/D.remot9876001 -- incomming message remote/X.systemN9876 -- incomming execute file Example B: C./C.remoteA1234 -- uucico work file D.system/D.systemB1232 -- outgoing message D.systemX/D.systemX1230 -- remote execute file D.remote/D.remoteS9872 -- incomming message D.remote/X.remoteA9873 -- incomming execute file So.. the Nutshell example has the potential for collision because two remote systems may try to create to same destination filename, since both are creating files on 'system' called 'D.syste*' and 'X.systemX*'. Example A has essentially the same problem with the execute file, and in addition, an incomming message file 'D.remot*' could collide with an outgoing execute file 'D.remot*'. Example B doesn't appear to have a collision problem, but the directory structure is complex, as is the process for transforming filenames. Consider this C.remoteA1234: S D.systemB1232 D.systemS1232 user - D.systemB1232 0666 S D.systemX1230 X.systemA1233 user - D.systemX1233 0666 The 'D.systemB1232' becomes 'D.system/D.systemB1232' however, the 'D.systemX1230' becomes 'D.systemX/D.systemX1230'. Messy! Finally, the job-id seems to be limited to 3 characters, since the fourth character appears to be used as the sub-sequence number. The scheme I plan to use prevents collisions and seems much more logical (IMHO :-) as well as following, to a reasonable extent, the Nutshell guide. Proposed: remote/C.remoteA1234 -- uucico work file remote/D.syste1234001 -- outgoing message remote/D.syste1234002 -- remote execute file remote/D.remot9876001 -- incomming message remote/X.remoteX9876 -- incomming execute file Using this scheme, control files are named after the system they refer to, but all other files are created with our system name since we have control over the sequence numbers in that "name space". The spool directory may be flat, and collisions are still prevented. If desired, for organization or performance reasons, traffic to and from a remote site can be handled in a subdirectory. Job-id's are easily tracked and the naming scheme in general is simple. Sorry to be so long-winded. I've tried to keep as much to the specifics as possible, but the examples were needed to clarify this abstract and poorly documented issue.