That looks like something platform‑specific which you would never see on a Windows® box.
Try putting those two into a Path object (or a java.io.File object) and call getXXX methods on them. Try for the path and the canonical path. I think you will find that the second turns into the first when you use the canonical path. What you have in the first is
1: You are looking for a file on your own machine rather than elsewhere via http, ftp, etc.
2: The / takes you to the very root of the file system.
3: dev/ is one of the directories in the file system.
4: It contains a file called urandom.
The difference in the second is that after dev, you are calling ./ Now . means current directory (I think it is the same on Windows®) so ./ means look in the same directory that you were in already. So you can remove the ./ and not change the meaning of the path. Or you can add ./ as often as you like (in the middle of the path String) without changing where you end up.
They are both the same: look. Same output for both
bash: file:/dev/urandom: No such file or directory
bash: file:/dev/./urandom: No such file or directory
you need the crazy-looking filename, e.g., the extra /./, to trick Java into accepting your filename. If you just use /dev/urandom, Java decides you didn't really mean it and replaces what you wrote with /dev/random.
Don't give up the day job.
(It's a valuable opportunity to catch up on sleep.)
Campbell Ritchie wrote:Have a cow for finding that strange behaviour. Is that a Java® bug?
Offhand, I'd guess that it's more of a Linux® feature and has to do with the original purely-mathematical means of finding random numbers (as dismissed in Knuth) and the later more truly random generator device.
In FreeBSD, urandom is softlinked to /dev/random. In my Linux machine they are distinctly different devices. Methinks the funny syntax is to portably defeat the softlink.
Blitzlügen - Lies or information broadcast, but when called out the broadcaster does little or nothing is done to correct them, thus allowing those who wish to believe to accept them as truth.
Lügensturm - A barrage of Blitzlügen fired in such quick succession that it is essentially impossible to correct them all.
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me: