frontier5.5 picture

macos picture

windows picture

web scripting

More on File Path Strings

We're backing off on the special parsing of Windows file paths described in File Paths in Frontier 5, and focusing on the file URL method, also described on that page.

We're also going to allow people to use / as a path separator in the Windows version. This means that no files can contain / as part of the file name. Matt Neuburg researched this a bit, and found that there's precendent for this in Microsoft tools and in PERL.

On the Mac the file path delimiter will be as it always was, a colon.

To get the ball rolling, I wrote a script called workspace.processFileURL. When this is final it'll be baked into the kernel in all verbs.

Anywhere a file path is legal, file:/// syntax will be legal too.

This is a fat page. Do a Get Page Data to copy workspace.processFileURL into your object db.

A new verb, sys.os, is used to tell what OS we're running under.

Here's the source for workspace.processFileURL:

on processFileURL (s)
local (prefix = "file:///")
if string.lower (s) beginsWith prefix
s = string.delete (s, 1, sizeOf (prefix))
s = string.urlDecode (s)
case sys.os ()
s = string.replaceAll (s, "/", ":")
s = string.replaceAll (s, "/", "\\")
return (s)
bundle «test code
dialog.alert (file.exists (processFileURL ("file:///Macintosh%20HD/Online%20Docs/admin/credits.html")))

This page was originally posted on 9/14/97; 11:47:31 AM. It was last built on 10/5/97; 12:45:26 PM with Frontier. Internet service provided by Conxion.