separator « File Attribute « Java I/O Q&A





1. Is there a C# equivalent to File.separator in Java    stackoverflow.com

How does C# cope with file separators? Is it always assumed the file separator is "\" (or "\\" and does this have to be escaped like this?

2. File separator vs pathseparator    stackoverflow.com

One is called a "name-separator" and the other a "path-separator" right here. What's the difference? When to use which one?

3. File.separator vs FileSystem.getSeparator() vs System.getProperties("file.separator")    stackoverflow.com

Why are there three different ways to get the file-separator in Java? Why would I use one over another?

4. file separators    coderanch.com

Hello, I am aware of using File.separator to specify system independent paths. But I was wondering, if that is really required. For example I read files in my windows machine using "/" as separator and it works. I use only relative path names. These paths should also work on Unix machines as "/" is the path separator there anyways. So do ...

5. file.separator    coderanch.com

6. File separator problem    forums.oracle.com

hi, my application will run on windows, and my file separator should be \ in order for my application to run properly, i need to code as: String file_str = "C:\\My_folder my_file.ppt"; but, the problem is the actual file_str is previously saved to database when i choose the required file from file chooser. so, when i retrieve it from database, it'll ...

7. Java File Separators    forums.oracle.com

8. File separator problem    forums.oracle.com

So what was wrong with just using replaceAll( " $", File.separator ); P.S. I have never found any of this necessary as long as content is to be used to construct a File object because '/' can then be used regardless of the OS. Edited by: sabre150 on May 16, 2009 3:55 PM

9. get the file separator    forums.oracle.com

So your question is how to figure out the separator being used in a file. The easiest way is to arrange for the separator to be written on a line all by itself at the start of the file. If that isn't going to work you have to start thinking about what you know about the data itself. For instance if ...