0

I wish to write a python script (to be run in Linux) that one of its requirements is to remove a directory. the problem is that the directory is very big and takes minutes to complete.

Problems:

  1. I don't want the remove command to block script execution
  2. most importantly I want the remove command to allow the script to finish its execution and keep working even after the script is terminated

is it doable?

Thanks in advance

idanshmu
  • 5,061
  • 6
  • 46
  • 92

1 Answers1

2

One thing that would satisfy those requirements would be a daemon. Fork and then return from the main process. That way the remove call can block as much as it likes.

doRemove()
   fork()
   if child
      call huge remove
   else
      return
dutt
  • 7,909
  • 11
  • 52
  • 85