posted on 08:53 AM on Friday 08 August 2014
Prior to removing a directory, it might be interesting to see if there are any symbolic links within it. The following is a short piece of Python code to do this.
#!/usr/bin/env python import os for root, dirnames, filenames in os.walk("."): for dirname in dirnames: if os.path.islink(os.path.join(root, dirname)): print os.path.join(root, dirname), " => ", os.readlink(os.path.join(root, dirname)) for filename in filenames: if os.path.islink(os.path.join(root, filename)): print os.path.join(root, filename), " => ", os.readlink(os.path.join(root, filename))
Supper at Changi Village (09:18 AM on Saturday 09 August 2014)
National Day Rehearsal (04:34 PM on Saturday 02 August 2014)