There are always two slashes in file://, just like there are always two slashes in http:// and ftp://. Whatever is after that depends on the path. All Unix-based operating systems use “/” for the root (so, everything except Windows basically). The only way file://var would work is if there’s a folder called var in the current path, which is unlikely since presumably you’re trying to get the var folder in root, which is /var.
You missed my point. I typed “…” at every location(I forgot the last two.). iOS persistant data path returns with /var at the beginning, so I type var.
and after some test, I find out that iOS should be file:///var/… . two slash plus persistant data path.
Now I have another question: There was an issue long time ago, that on iOS, load a string from url using www will be unconditionally cached. And when I change the content inside the url, www will not load the newest string, but the old cached one, even when I call a method that disable www cache. I have to add a parameter after the url like ?p=20171017123015468, so that iOS think that this is a new url. Is this bug already fixed?
According URI specification there should always be 3 slashes. You have file:// followed by absolute path. It is somewhat confusing on Windows, as paths here don’t start with slash, yet the proper URI on Windows is in fact file:///C:/…
It is a common error to put only 2 slashes on Windows and some software does support that.
I recommend using System.Uri class to create file URIs, you won’t need to deal with system then and will get tahe conformant URIs.