问题
There's many projects which are using File.separator as path separators. But why do it's using on Android? I know that it can be useful on cross-platform apps, where Windows using \, and Linux using / as a separators, but are developers really think that Android projects will be launch on Windows in future, or is it only an historical reasons? Obviously, that it's more useful to use / instead of File.separator, even to add it to the variable like fileSep or fs.
Thanks!
回答1:
Android runs on top of Linux. So all file separators and similar settings use the same as Linux. People using File.separator are either running (or copying) Java code meant to be multi-platform, or are being extremely cautious.
来源:https://stackoverflow.com/questions/44558780/why-is-file-separator-in-android-using