.... you might be able to look at the fd file numbers in /proc/$pid/fd, store them in arrays as they get created.... i.e. as you open a filehandle, get it's fd and store it, so you can delete them later by fd...... i wonder what would happen if you just recursively delete /proc/$pid/fd/* .... i hesitate to try....maybe it would make zombies? with fd's 0,1,, and 2 gone?