Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!newsfeed.kamp.net!newsfeed.kamp.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'root,': 0.07; 'compute': 0.09; 'files:': 0.09; 'dirs,': 0.16; 'files)': 0.16; 'set()': 0.16; 'subject: \n ': 0.16; 'subject:based': 0.16; 'subject:values': 0.16; 'typo': 0.16; 'wrongly': 0.16; 'wrote:': 0.17; 'sorry,': 0.22; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'am,': 0.27; 'node': 0.29; 'writes:': 0.29; "i'm": 0.29; '(and': 0.32; 'file': 0.32; 'subject:data': 0.33; 'to:addr :python-list': 0.33; 'code:': 0.33; 'list': 0.35; 'path': 0.35; 'should': 0.36; 'reported': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'received:74.208': 0.71; 'received:74.208.4.194': 0.84; 'join.': 0.93 Date: Wed, 06 Mar 2013 08:31:40 -0500 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130221 Thunderbird/17.0.3 MIME-Version: 1.0 To: python-list@python.org Subject: Re: sync databse table based on current directory data without losign previous values References: <390f0dc5-5750-4849-9433-a19d90cc8566@googlegroups.com> <3958fc2b-a2fe-4c85-a104-4c6f551cf787@googlegroups.com> <28828019-279a-4d8c-a7ea-ba677b4a8165@googlegroups.com> <87r4jsj019.fsf@nautilus.nautilus> In-Reply-To: <87r4jsj019.fsf@nautilus.nautilus> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:9Vg2oDutxvkdRVm+f5edt/HfD7jZCNy/ICk9F0COEKk xb7+v+bRtrynbdml/jLOQT8Rt5tKQBkXXGKgOEpNIjqE9UhYt9 hv1uPIUJ39uicT71OceZo6bbAn6I2p7O6b075YwMovWYr6LaLz Az0wo4szo+s4iwsewoYB2F6hVQBZe8iYIt3Pk8TeSkzs50nZA9 msaDEW300XdmcGPG36UwSmdz55Gi7R4ClUkClbZJpJ0tJS/q5C UNIb52Zq28//+eIfzbMqW1vjjiemVfSTG1sYZELn5mNQQALNHD O73mUocBUPxdmVAyo6Ytg3NBuRj7gAkKNWKyQvd01AkyCplgA= = X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 27 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362576723 news.xs4all.nl 6979 [2001:888:2000:d::a6]:53572 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40635 On 03/06/2013 05:27 AM, Lele Gaifax wrote: > Νίκος Γκρ33κ writes: > >> Its about the following line of code: >> >> current_fullpaths.add( os.path.join(root, files) ) > > I'm sorry, typo on my part. > > That should have been "fullpath", not "file" (and neither "files" as you > wrongly reported back!): > > # Compute a set of current fullpaths > current_fullpaths = set() > for root, dirs, files in os.walk(path): > for fullpath in files: 'fullpath' is a rather misleading name to use, since the 'files' list contains only the terminal node of the file name. It's only a full path after you do the following join. > current_fullpaths.add(os.path.join(root, fullpath)) > -- DaveA