How to test for file? 
Author Message
 How to test for file?

Hello, I'll start off by saying, I'm new to perl!  :-)
I need some help with a script I have.
I have a Solaris 7 system for our Intranet, and an NT system for the audio
server.
What I am trying to do is have a link on out Intranet to our audio server so
our users can listen to certain meetings, etc.
The script first does a test to see if there is any audio being sent, if
not, a message displays that says "No meetings at this time"
The problem I'm having is, I don't know how to make the perl script test for
the audio server file on the NT system.  It doesn't see the audio file, the
path is correct.  Even when I put the IP address in the path, it has the
same result.
Here's what I have so far:
#!/usr/local/bin/perl
############################################################
# This script checks to see if the broadcast is available, #
# then directs to the appropriate page.                    #
############################################################

if (-e "file://Audio/stream/Station1.asx") {

  print "Content-type:text/html\n\n";
  print "<html><head><title>MeetingBoard Audio&nbsp;&nbsp;&nbsp;&nbsp;
</title></head>\n";
  print "<body bgcolor=white>\n";
  print "<center><font face=arial size=2><p><br><br>\n";
  print "\n</body></html>\n";
  print "This broadcast requires Windows Media Player 6.4 or above. ";
  print "If you already have it, <A
HREF=file://Audio/stream/Station1.asx>click here</A> for the broadcast. ";
  print "Otherwise you can <A
HREF= http://www.*-*-*.com/ ;<IMG
SRC=/images/getmedia_whi
te.gif WIDTH=65 HEIGHT=57 BORDER=0 VSPACE=7></A>";

Quote:
} else {

  print "Content-type:text/html\n\n";
  print "<html><head><title>Meeting Board Audio&nbsp;&nbsp;&nbsp;&nbsp;
</title></head>\n";
  print "<body bgcolor=white>\n";
  print "<center><font face=arial size=2><p><br><br>\n";
  print "\n</body></html>\n";
  print "There is nothing to broadcast right now. Please check ";
  print "the meeting schedule on our What's New page for the ";
  print "next meeting to be broadcast. Thank you.";

Quote:
}

Any help would be greatly appreciated!
Thanks,
Don


Sat, 14 Dec 2002 03:00:00 GMT  
 How to test for file?
    Hi,


Quote:
>I have a Solaris 7 system for our Intranet, and an NT system for the audio
>server.
    --snip--
>The script first does a test to see if there is any audio being sent, if
>not, a message displays that says "No meetings at this time"
>The problem I'm having is, I don't know how to make the perl script test
for
>the audio server file on the NT system.
    --snip--
>if (-e "file://Audio/stream/Station1.asx") {

    well the problem is: You need to check from a Solaris machine
    for the existence of a file on a NT box.
    You can only check for the existence of a file if you have
    (somehow) access to the file system of your NT box. A link
    like file://.... does not do this. I t is intended to tell a client
(browser)
    where to look for additional information.
    There are several ways to check for the existence of your files:

        a) Use a smb client (contained in the solaris samba package)
        to connect from unix to nt and share the directory on your nt box.
        b) use nfs for nt instead.
        c) use ftp for communication (ftp server on nt).
        d) write your own client and server...

    You can even do it the other way round with the nt box being the
    client telling the unix box when files are available...

    Good luck ;-)

    Best regards,

        Peter Dintelmann



Sun, 15 Dec 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Troubleshooting Perl Script That Creates Multiple Test Data Files

2. How to test for file Perl

3. How to test for file?

4. Best Way to Test if File Exists

5. Perl Newbie Question: test if file exists..

6. How to test for file Perl

7. 'awk' test for file existance fails with nawk and gawk

8. How to test a files is already open (PERL 4) ?

9. file tests with for user inputted file

10. Removing files - File tests

11. File test operators can't tell a file from a directory

12. -s file test on big files

 

 
Powered by phpBB® Forum Software