Created
March 16, 2011 03:46
-
-
Save mgodave/871978 to your computer and use it in GitHub Desktop.
Using java.io.FileDescriptor
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
;; Problem: I have a raw file descriptor, from a parent process and I need to read from it: | |
(import java.io.FileDescriptor) | |
(import java.io.FileInputStream) | |
(def fdfield (.getDeclaredField (Class/forName "java.io.FileDescriptor") "fd")) | |
(def fd (FileDescriptor.)) | |
(.setInt fdfield fd 10) | |
(FileInputStream. fd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment