I use file:// to point to local file.
file://localhost/Users/smcho/Desktop/softwaredevelop/15.pdfCan't I use file:// to point to the local file relative to current directory? I mean the current directory by where the file containing the file:// is located.
file://./../15.pdfI need file:// to link a file in Leo. With Leo, I use file:// to link to a local file, and I want to point to files that are located in relative directory to current directory. I asked similar question in Google forum.
4 Answers
file://is for absolute paths. But the following will be relative to your working directory:
file:./15.pdf 1 I'm not familiar with the Leo outlining software, but if it handles links the same way a web browser does, try the following
../15.pdffile:../15.pdf
Notes
A relative link usually doesn't include the protocol (like
http:orhttps:orfile:). When the protocol is omitted, a web browser will use the same protocol as the page the link appears in.An absolute link begins with
//. A relative link shouldn't begin with//.The
./is only needed if you are linking to the folder that contains the page exactly. Otherwise, you can leave it out and start with../.---- In your thread in the leo-editor group you said
file:./../15.pdfcaused an error. Maybe the./../combination is confusing your software. Perhapsfile:../15.pdfwill work?
Relative to what? URIs by definition are absolute. However you can make your URI relative to a known location, like this:
file://localhost/Users/smcho/Desktop/softwaredevelop/somedir/../15.pdfUpdateFrom what you said it sounds like you are trying to open a PDF from within your application. Typically this is done by just executing the file and letting the OS figure out how to handle it. In Python you would use something like:
os.startfile("../15.pdf")URIs like file://... are typically used in the context of web-based applications.
MyClass.class.getResource("/com/fnf/si/DepAcctInq_V02.wsdl"); It worked for me
1