This reverts commit 17b8b86d68. Reverted because of lingering file descriptors (memory leak)
17b8b86d68