Created
November 16, 2010 04:44
-
-
Save lvsl-deactivated/701434 to your computer and use it in GitHub Desktop.
How to close all files except stdin,stdout,stderr in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In case you use some sloppy daemon starter script do this. | |
os.closerange(3, rosource.RLIMIT_NOFILE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
os.closerange(3, resource.getrlimit(resource.RLIMIT_NOFILE)[0])