You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Rainer Perl <r....@aircall.at> on 2002/10/18 11:20:58 UTC

Strange problems with smbmounted files

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


Re: Strange problems with smbmounted files

Posted by Gerald Richter <ri...@ecos.de>.
>SuSE Linux 7, Kernel 2.4.4-4GB
>Apache/1.3.19
>EmbPerl 1.3.4
>...
> So it seems to be a
> problem with EmbPerl, doesn't it?

I am quite sure that Embperl 1.3.4 does close it's files correctly, but
Linux 2.4.4 is known to be quite buggy. I would suggest to upgrade your
kernel and then your problems should go away

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