I\'m writing a program that will watch a particular directory for new files containing download URLs. Once a new file is detected, it will create a new process to do the act
If you don't care about when and whether the child terminates, and you just want to avoid the child ending up as a zombie process, then you can do a double-fork, so that the grandchild ends up being a child of init. In code:
def child(*args):
p = Process(target=grandchild, args=args)
p.start()
os._exit(0)
def grandchild(filename, wDir, dDir):
# Open filename and extract the url
...
# Download the file and to the dDir directory
...
# Delete filename from the watch directory
...
# exit cleanly
os._exit(0)