Weekend project - Directory simplifier - Shortest paths..

R

rh0dium

Hi all,

OK I have two lists of directories..

Master
lista=["pad/foo/sch/filea","pad/foo/sch/fileb","pad/foo/sch/filec","pad/foo/lay/filea","pad/foo/lay/fileb","pad/foo/lay/filec","pad/bar/sch/filea","pad/bar/sch/fileb","pad/bar/sch/filec",,"pad/bar/lay/filea","pad/bar/lay/fileb","pad/bar/lay/filec","pad/zen/filea","pad/zen/fileb","pad/a",
"pad/b"]

Changed
listb=["pad/foo/sch/filea","pad/foo/sch/fileb","pad/foo/sch/filec","pad/foo/lay/filea","pad/foo/lay/fileb","pad/foo/lay/filec","pad/bar/sch/filea","pad/bar/sch/fileb","pad/bar/sch/filec",,"pad/bar/lay/filea","pad/bar/lay/filec","pad/zen/fileb",
"pad/b"]

Now what I want to get out of this is the top most directory which
could be used for a copy.. In other words I would like the results of
this to be this

final=["/pad/foo", "pad/bar/sch", "pad/bar/lay/filea",
"pad/bar/lay/filec", "pad/zen/fileb", "pad/b"]

So what I need it to do it to look backwards in the Master list and
find all similiarites in Changed.. I don't even know how to approach
this - can someone give me a hand with this.

Thanks much!!
 
R

rh0dium

rh0dium wrote:

It should be noted that these are virtual not real so filecmp can't be
used...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top