Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  

file test com cgi


bom dia,

tenho o seguinte codigo:

#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";

$EnviaBMF_esalq_bmf1 = "/mnt/arquivos/ATUALIZA/agrocast/bmf/esalq_bmf.txt";
$EnviaBMF_esalq_bmf2 = "/mnt/arquivos/SERVICOS/ESTADO/BMF/esalq_bmf.txt";
#$teste = "/mnt/teste.txt";

print <<HTML;
<H1>Verificacao de arquivos</H1>

print "<P>ENVIA_BMF<BR>";
print "<FONT SIZE=2>";
print $EnviaBMF_esalq_bmf1;
print "</FONT><BR>";
if ( -z $EnviaBMF_esalq_bmf1 ) {
print "S:\\ATUALIZA\\agrocast\\bmf\\esalq_bmf.txt - <B>EXISTE</B>";
} else {
print "S:\\ATUALIZA\\agrocast\\bmf\\esalq_bmf.txt - <FONT COLOR=RED><B>não EXISTE</B></FONT>";
print "<BR>";
if ( -z $EnviaBMF_esalq_bmf2 ) {
print "S:\\SERVICOS\\ESTADO\\BMF\\esalq_bmf.txt - <B>EXISTE</B>";
} else {
print "S:\\SERVICOS\\ESTADO\\BMF\\esalq_bmf.txt - <FONT COLOR=RED><B>não EXISTE</B></FONT>";


/mnt/arquivos é um diretório montado de um outro servidor.

o problema: se eu executo o arquivo .pl como "perl arquivo.pl", os if -z retornam true. Porém, quando executo pelo navegador, esses if -z retornam false.

Caso o teste seja feito com um arquivo local, no navegador retorna true.

Alguma idéia?

Share this post

Link to post
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Forum Statistics

    • Total Topics
    • Total Posts
  • Create New...