[spambayes-dev] Re: Pickle vs DB inconsistencies

T. Alexander Popiel popiel at wolfskeep.com
Wed Jul 9 11:32:57 EDT 2003


In message:  <1ED4ECF91CDED24C8D012BCF2B034F13024E96D2 at its-xchg4.massey.ac.nz>
             "Meyer, Tony" <T.A.Meyer at massey.ac.nz> writes:
>
>[Separating dbExpImp into export and import]
>> (Note that I said "one command", not "one script".  From a=20
>> Unix perspective, it would make perfect sense to have one=20
>> script, and make sb-export and sb-import both symlinks to it.=20
>
>No doubt this is my Windows-ness showing, but I don't understand the
>difference between a command and a script.  Do you mean that
>sb-export/sb-import are little scripts that import dbExpImp.py (or
>whatever it gets called) and call the appropriate function?  Or do you
>mean that sb-export/sb-import call dbExpImp.py with options that make it
>do the right thing?

Neither of the above.  What he's referring to is that in the Unix
world, a single file can have multiple names associated with it.
More thoroughly, directory entries just refer to inode numbers,
and it's the inodes that hold the actual files; multiple directory
entries in arbitrary places in the filesystem can reference the
same inode number, and thus the same file.  Thus, 'sb-export' and
'sb-import' could just be two names for literally the same file,
and it'd tell how it was supposed to behave at runtime by checking
which filename was used to invoke the process.  This runs into
a bit of difficulty if you invoke through yet a third filename
(or by invoking a specific version of python and providing the
script as first argument instead of as the program name).

I've commonly seen this sort of thing done where the two behaviours
are controlled by optional command-line parameters, and the invocation
name is referenced only if none of the behaviour-specifying parameters
is present.  This gets around the fact that people can trivially
invent new names for files, or simply lie about the name of the
executable file when spawning a process.

>> Dunno how Windows people deal with that sort of thing.)

They generally don't, since Windows filesystems don't have the
concept of inodes as independent entities from the directory
entries.  This lack manifests in many annoying ways, including
the inability to delete a file or move a file while another
process has it open, the inability to move a directory when
some process has a child of that directory selected as the
'current' directory, etc.

- Alex



More information about the spambayes-dev mailing list