New file utility for shutil - linktree.py

Bjorn Pettersen BPettersen at NAREX.com
Mon Dec 30 15:34:26 EST 2002


> From: David MacQuigg [mailto:macquigg at cadence.com] 
> 
> I need a 'linktree' utility to create a "mock hierarchy" for 
> testing patches to our mongo software distributions (~2GB, 

[...]
> I decided to extend the 'os.path.exists' function, adding an 
> optional argument to specify *exactly* what you want tested.  

I like the idea, but not the implementation. If you need that
functionality _I_ would definitely prefer to have a separate and
appropriately named function in os.path. This issue is orthogonal to the
rest of your proposal, so I would suggest submitting a patch for this
first (judging from history, I'd suggest you accompany it with a
thorough explanation of why you can't do it with the existing machinery
<wink>).

[...]
> My questions for this group are:
> 1) Is 'linktree' or something like it generally useful, or 
> too specialized for inclusion in the Python distribution?

Since Win* doesn't have symlinks it wouldn't do much for me <wink>. I'll
let others decide if it's generally useful on *nix... If you can't get
it in shutil, you might be able to get it in tools/scripts (don't know
what the entry criteria are there, but they seem relatively liberal ;-)

> 3) Can you think of any improvements?  Other applications I 
> should consider?

The only code-nit you're going to run into is that "from os.path import
*" is a definite no-no (fully qualify your names). Oh, and I wouldn't
expect a library call to print anything since I might not have a
console...

Good luck.

-- bjorn




More information about the Python-list mailing list