On monday I posted the below code:

def schmove(src,dst):
...         src = '/home/datasvcs/PIG/cjomeda_exp/'
...         dst = '/home/datasvcs/PIG/cjomeda_exp_archive/'
...         listOfFiles = os.listdir(src)
...         for filez in listOfFiles:
...             os.system("mv"+ " " + src + " " + dst)

David Angel replied to my post and I guess I accidentally deleted his response. 
Today I found his response posted on mail-archive.com and tried some 
variations. They all failed.

David said, "Just use os.rename() if the dest is a directory, it'll move the 
file there."

Example: If I use: "os.rename(src, dst)" where I had "os.system("mv"+ " " + src 
+ " " + dst)" no files are coppied.

os.renames happily renames the source directory, but that's not what I want.

Any other suggestions?

-- Matt



-- 
I fear you speak upon the rack,
Where men enforced do speak anything.

- William Shakespeare
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to