You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Alexander Hartmaier <Al...@t-systems.at> on 2002/05/06 14:57:12 UTC

Embperl 2.0b7 problem with directory handling


Hi!

I discovered this problem serveral times.

First when an embperl script fails there is such a log entry:
[11526]Reading //fatal.epl as input using PerlIO (0 Bytes)...
[11526]ERR:  12: fatal.epl(1): File //fatal.epl open error: No such file or
directory

I've got a fatal.epl in the same directory as the called .epl file but it isn't
used. Instead embperl looks for //fatal.epl (which is different than in 1.3.x).


When I use the following command to get the current url (and append it as an cgi
var to submit the next called page where she should link back) I get the full
path (eg "/admin/view-table.epl" instead of "view-table.epl").

[-
$retcmd = $ENV{"REQUEST_URI"};
-]

I also have a problem where I have to define 2 variables for one file (one is
the real filename with the complete path and a second for the web link).
$fname = "/home/nac/web/tmp/$what-$type-$intid-$offset-$now.png";
$rname = "../tmp/$what-$type-$intid-$offset-$now.png";

In embperl 1.3.x i could use the $rname for both the file access and as
web-link. Since Embperl 2.x the relational path didn't work any more and the png
files where created in "/tmp" instead of "/home/nac/web/tmp".

I used the following test script:

[! use Cwd; !]
<html>
<head><title>directory test epl</title></head>

<body>
  <a>I think I am in [+ cwd +]</a>
</body>
</html>

Is this a bug or a feature?

Yours sincerly
Alexander Hartmaier

T-Systems

T-Systems Austria

address: Hofmühlgasse 3-5, 1060 Wien
telephone: +(43) 1 599 03 - 4320
fax: +43 1 595 34 67- 4152
mobile:
mail: alexander.hartmaier@t-systems.com
Internet: http://www.t-systems.at



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Embperl 2.0b7 problem with directory handling

Posted by Gerald Richter <ri...@ecos.de>.
>First when an embperl script fails there is such a log entry:
>[11526]Reading file://fatal.epl as input using PerlIO (0 Bytes)...
>[11526]ERR:  12: fatal.epl(1): File file://fatal.epl open error: No such
file or
>directory

Embperls Execute function takes a filename and _not_ a URL. This is the same
in 1.3 and 2.0. Embperl itself never would add this file:// prefix, you must
given it somewhere. Just remove it and it should work ok.

>When I use the following command to get the current url (and append it as
an cgi
>var to submit the next called page where she should link back) I get the
full
>path (eg "/admin/view-table.epl" instead of "view-table.epl").
>
>[-
>$retcmd = $ENV{"REQUEST_URI"};
>-]

Yes, that's how REQUEST_URI is defined in the CGI spec. Embperl doesn't
change any environment variable.

I also have a problem where I have to define 2 variables for one file (one
is
the real filename with the complete path and a second for the web link).
$fname = "/home/nac/web/tmp/$what-$type-$intid-$offset-$now.png";
$rname = "../tmp/$what-$type-$intid-$offset-$now.png";

>In embperl 1.3.x i could use the $rname for both the file access and as
>web-link. Since Embperl 2.x the relational path didn't work any more and
the png
>files where created in "/tmp" instead of "/home/nac/web/tmp".
>
>Is this a bug or a feature?

This is a feature. Embperl 2.0 avoids to make a chdir for every sourcefile
(which could be a lot, in case you use several source files to build one
page). You can get the path of the current page with

[- $req = shift -]
[- $path = $req -> component -> cwd -]

and then simply prepend it to your relativ path. There is an option on the
TODO list, that will allow you to the old behaveiour in one of the next
versions

Gerald



-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------





---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org