[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Trouble opening template file



Ë 19:07 -0500 29/09/96, Robert Stober nous disait:


> print &Templates::FillTemplateFile("../templates/store.html", %vars);
....
> So I can't understand why the file can't be opened. Is ../ a legitimate way
> to change directories in MacPerl?

hi,

There is a common confusion between URLs (the location of a file for the
Web server) and the actual location of a file on the hard disk.

In short, if you want your CGI:

        1 - to display a file in a web browser, use its URL

        2 - to do some work on a file behind the scene,
            use its actual pathname on your hard disk

When using URLs the slash caracter is a valid item delimiter but for
MacPerl to work on files (read from, write, create, delete, etc.) you have
to use the actual pathname on your file system. On a  Mac you have to use
colons (:).

You might want to use the full pathname of your file instead of using '..'.

Your code could be:

$templatesFolder = "HardDisk:SomeFolder:templates:"
print &Templates::FillTemplateFile($templatesFolder."store.html", %vars);

Hope it helps,
Stephane

_______________________________________________
G   E   S   C   O   M    Info:Communication Inc
tel: (514) 762-1958         fax: (514) 762-4296
info@gescom.qc.ca       http://www.gescom.qc.ca