On Wed, 06 Mar 2013 12:52:00 +0100, Mark Lawrence
<breamore...@yahoo.co.uk> wrote:
On 06/03/2013 07:45, Νίκος Γκρ33κ wrote:
I'am using this snipper to read a current directory and insert all
filenames into a databse and then display them.
But what happens when files are get removed form the directory?
The inserted records into databse remain.
How can i update the databse to only contain the existing filenames
without losing the previous stored data?
Here is what i ahve so far:
==================================
path = "/home/nikos/public_html/data/files/"
#read the containing folder and insert new filenames
for result in os.walk(path):
You were told yesterday at least twice that os.walk returns a tuple but
you still insist on refusing to take any notice of our replies when it
suits you, preferring instead to waste everbody's time with these
questions. Or are you trying to get into the Guinness Book of World
Records for the laziest bastard on the planet?
Hold on a sec ...
He has
for result in os.walk(path):
for filename in result[2]:
So he *did* take notice of that.
Nikos:
Expectation is to iterate through a tuple like this:
for dirpath, dirnames, filenames in os.walk(path):
...
--
http://mail.python.org/mailman/listinfo/python-list