wtd @ Mon Mar 02, 2009 3:46 pm wrote:
My hatred comes from familiarity.

Funny, I get the same feeling about C++ - after using it for a while, it just looks like a collection of design errors and clever traps designed to snare the unwary.
But, we're side-tracking this thread. The answer to the original question is this:
- You can't retrieve the file name from a Scanner. Scanners do not necessarily scan files.
- You can keep track of the opened file separately if you're in a context where you happen to know that the Scanner IS actually scanning a file. Do this with a String.