OT: Using the 'FILE' protocol?

Perhaps, try using the quotes only around the sections of the patch that include spaces: file://D:/Docs/SUNDRY/'Internet Radio'/'BBC stations etc.txt'

Richard

Reply to
Richard H.
Loading thread data ...

This is a bit obscure, but I hope one of the programmers here can help please.

One of the features of my text editor (the excellent TextPad from Helios Software) lets me paste a URL into a document and go to it directly on the web by r-clicking and choosing the top item, Open.

I'd like to be able to do the same for files on my HD. IOW, select text like this: D:\\Docs\\Electronics\\CIRCUITS\\CM\\Switches\\NO-Button.gif and open that file, just as if I was doing so from a Windows XP folder.

After some research, I found a partial solution. If I convert that file name to this syntax (protocol?) file://D:/Docs/Electronics/CIRCUITS/CM/Switches/NO-Button.gif then I can open it. But it fails if there are any spaces in the path or filename, such as 'file://D:/Docs/SUNDRY/Internet Radio/BBC stations etc.txt'

Anyone know how to get around that please? Placing it in quotes didn't work.

--
Terry, West Sussex, UK
Reply to
Terry Pinnell

Place a %20 as space replacement ? the 20 being the hexcode for the ASCII space.

Rene

--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
Reply to
Rene Tschaggelar

Replace the space with the hexadecimal code for a space, which is: %20

Also, if seem to remember that formally you have to use a vertical line character after the drive letter rather then a colon. Thus: 'file://D|/Docs/SUNDRY/Internet%20Radio/BBC%20stations%20etc.txt'

But within windows applications the colon mostly seems to work.

Succes,

Bas

---------------------------------------------------------- Any errors contained herein are copyrighted, however, you may use them at your own risk.

----------------------------------------------------------

Reply to
john coates

Thanks both. That looked *so* right. And the text turned blue, just as it does with a URL. But sadly, on r-clicking and choosing Open, TextPad didn't like it: "The system cannot find the path specified."

BTW, changing the colon to | was a retrograde step (it lost the rest of the blue text).

One other thought was along the lines of changing it to its 'DOS' name, the one with ~ characters and serial numbers. I used to know some way of generating that abbreviated 'no blanks' name automatically. Something like dragging it into a DOS window? But just tried dragging that file into a Win XP Command Prompt window and it appears with the full name, so maybe I'm imagining it.

I've emailed Keith MacDonald, TextPad's author, to see if he can shed light. Could be it's impossible.

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

Thanks, but afraid not. Here, using Agent, I can tell in advance that it won't work in TextPad, as that text does not appear in green as all URLs do, or as this line does: file://D:/Docs/SUNDRY/Internet%20Radio/BBC%20stations%20etc.txt

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

One solution would be to replace Texpad with Zeus :)

formatting link

Zeus can open URL's or local files using the "View, Open Include File" menu.

I am pretty sure this would work "out of the box", but even if that did fail to open the file correctly, you could also resort to creating a simple Zeus macro to also open the file.

Note: Zeus is shareware (45 day trial).

Jussi Jumppanen Author: Zeus for Windows

Reply to
jussij

If it turns out that TextPad isn't able to cope with the space, a last resort might be to use the DOS "short name" for the file. Any file with a name that doesn't fit into the old "8.3" format is automatically given an alternate name by the operating system. The command 'dir /x' will show you short names, but except when there are conflicts, you can generally guess: it will be the first six letters of the name, skipping spaces, followed by a ~ and a digit. For instance, the name you gave is probably:

d:\\docs\\sundry\\intern~1\\bbcsta~1.txt

From the OS' perspective, the two names are interchangeable and refer to the same entity.

Reply to
Walter Harley

I see the same thing in Free Agent. When at a DOS prompt you need double-quote marks around a parameter or filename that has spaces in it, but if it's the last parameter, you can leave off the end quote. All these things are kludges to make things backwards (semi-)compatible, and they don't always work in all circumstances and for all programs. This is probably tracable to the DOS 8.3 filename limitation that was expanded on in Windows 95. The original 8.3 spec forbids spaces in filenames. There's no really good solution to this problem.

( C&C warning )

Perhaps you could write Bill Gates about it...

Reply to
Ben Bradley

Thanks Walter, that works! Note that the separator needed changing from \\ to /, i.e: file://d:/docs/sundry/intern~1/bbcsta~1.txt

Unfortunately there's a remaining snag. I was able to write a simple macro within TextPad to convert D:\\Docs\\SUNDRY\\Internet Radio\\BBC stations etc.txt to file://D:/Docs/SUNDRY/Internet Radio/BBC stations etc.txt or file://D:/Docs/SUNDRY/Internet%20Radio/BBC%20stations%20etc.txt

But that relatively simple operation isn't possible if I have to go to a Command Prompt to generate the DOS short name. As you say, I can guess, but wouldn't like to rely on that, and anyway that slows down what's intended to be an automatic procedure.

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

Thanks, Jussi, but I'm deeply committed to TextPad .

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

?But it fails if there are any spaces in the path or filename, such as

It has always seemed STUPID to me to (seemingly) allow spaces in a path or filename. If you avoid them, you save yourself headaches. It takes 3 characters to make one. When backing up to CDs (Joliet), this quickly becomes obvious. . . Try it with 3 slashes: file colon slash slash slash C colon slash directory slash subdirectory slash filename.ext (It really sucks that search engines don't take punctuation for search terms.) 8-)

file:///D:/Docs/SUNDRY/Internet%20Radio/BBC%20stations%20etc.txt . . Why? http://66.102.7.104/search?q=cache:BP8bkYUnjsgJ:groups.yahoo.com/group/www-lib/message/930+localhost+three-slashes+zzz+file-localhost+RFC-1738

...and yes, it would be called a *protocol*.

Reply to
JeffM

Bingo - thanks! This works fine: file:///D:/Docs/SUNDRY/Internet%20Radio/BBC%20stations%20etc.txt and is easily constructed automatically.

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

I don't know what TextPad's macro language capabilities are. Can it call functions in DLLs, as is possible from (for instance) Visual Basic?

If so, then you can use Windows itself to do the conversion. An example of this (in VB) is shown at

formatting link

Reply to
Walter Harley

Thanks. TextPad isn't up to that, but I'll have a play with it in Excel (if I can remember how ).

--
Terry Pinnell
Hobbyist, West Sussex, UK
Reply to
Terry Pinnell

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.