perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rainer Perl" <r.p...@aircall.at>
Subject Strange problems with smbmounted files
Date Fri, 18 Oct 2002 09:20:58 GMT
Hi,

Here is my setup:

SuSE Linux 7, Kernel 2.4.4-4GB
Apache/1.3.19
EmbPerl 1.3.4


I've mounted (via smbmount) a directory which is hosted on a Windows
2000 server. In this directory, there is a html-file. I want to open it,
read it's content and display it within an embperl-generated page:

--snip--
<div style="font-family:verdana;
font-size:12px;padding:10px;padding-top:0px;">
[-
 $escmode=0;
 open(INFILE, '/usr/local/smbmount_w2k/test.html') || die;
 $FileContent = '';
 while(\<INFILE>) { $FileContent .= $_; }
 if($FileContent =~ /\<body[^>]*>(.*)\<\/body>/si) { $FileContent = $1;
}
 close(INFILE);
 print OUT $FileContent;
 $escmode=2;
-]    
</div>
--snip--

This seemed to work - at first. But if I change the file (test.html) on
the server and reload the embperl (epl)-page, the changes do not show
up. I first thought "oh, I see - a cached epl-page" - but a "cat
/usr/local/smbmount_w2k/test.html" also shows the unchanged version.
So it is a smbmount-issue? No. Change the file (test.html) again (on the
server), do the cat again -> changes are there. Change html, do the cat
-> changes are there. Change html, reload epl-page: changes do not show
up. Cat html: changes do not show up.
So maybe the file is not closed properly? I changed the open-part of the
code to:

--snip--
 open(INFILE, 'cat /usr/local/smbmount_w2k/test.html |') || die;
--snip--

And I also tried

--snip--
 system("cp /usr/local/smbmount_w2k/test.html /tmp/$$.autoshow");
 open(INFILE, "/tmp/$$.autoshow") || die;
--snip--

But still no luck.

So I thought "maybe it's an issue with apache or mod_perl itself?" and
wrote the following cgi-script:

--snip--
#!/usr/bin/perl -w

use strict;

print "Content-Type: text/html\n\n";
open(INFILE, '/usr/local/smbmount_w2k/test.html');
while($_=<INFILE>)
{
 print;
}
close(INFILE);
--snip--

And it works fine, reflects all changes instantly. So it seems to be a
problem with EmbPerl, doesn't it?

Any hints/suggestions?

Regards,

	Rainer Perl

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


Mime
View raw message