All right, I have gotten quite a bit closer, but Python is now
complaining about the directory not being empty:

✈dcl:test$ cat moveUp.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
currentDir = os.getcwd()

filesList = os.walk(currentDir)
for root, folder, file in filesList:
    for f in file:
        toMove = root + "/" + f
        #print toMove
        os.rename(toMove, currentDir)

✈dcl:test$ ./moveUp.py
Traceback (most recent call last):
  File "./moveUp.py", line 11, in <module>
    os.rename(toMove, currentDir)
OSError: [Errno 39] Directory not empty


I am aware that the directory is not empty, nor should it be! How can
I override this?

Thanks!

-- 
Dotan Cohen

http://bido.com
http://what-is-what.com
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to