Detecting input redirection file
How can we detect/fetch the name of a file that's fed as an input redirection to a java program from the command line开发者_如何学运维?
Without OS-specific hacks (such as running ps -ef
) you can't.
Why do you need this information, and why can't you restructure your program to simply take the file as a command-line argument?
精彩评论