Solved

Checking if a file is there

Posted on 2001-08-12
2
130 Views
Last Modified: 2013-12-25
Using perl how can i check if a file exists on the server
0
Comment
Question by:kplonk
2 Comments
 
LVL 3

Accepted Solution

by:
bigbed earned 50 total points
ID: 6379305
if ( -e 'fullpathnametofile' )
{
    # do stuff here
}

other tests include:
-d : directory
-f : plain file
-w : file is writable
-x : file is executable
-r : file is readable
-z : file has zero size
-s : file has non-zero size

have fun
0
 

Author Comment

by:kplonk
ID: 6401743
Thanks did the job nicly
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Making a simple AJAX shopping cart Couple years ago I made my first shopping cart, I used iframe and JavaScript, it was very good at that time, there were no sessions or AJAX, I used cookies on clients machine. Today we have more advanced techno…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question