This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Is there a way I can specify the file format of a .java file (Mac, PC or Unix) when reading it ? For instance, if I read a java file created on a Mac OS, from a PC, the line temination characters are going to be different...
You shouldn't need to. As per the JLS, both Unix and Windows line line termination styles are legal. If a Java editor won't render one of these, it's a bug (at least according to the JLS).
In any case, Eclipse renders either type fine.
As for stripping off Windows-style line terminators when moving files about, I tend to use Emacs for this...I've never had to do enough that I've researched a better way. I imagine there's a single sed command that would do it though
--Tim [ July 20, 2004: Message edited by: Tim West ]