473,408 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Check to see if file exsists (perl running on vista)

Hey I'm trying to see if a file exsists but I'm using windows, I know in Linux you can use -e but that doesn't seem to work for me in windows.

Expand|Select|Wrap|Line Numbers
  1.     if (-e $filename)
  2.     {
  3.         print "File Doesn't Exist!";
  4.     }     
  5.  
Mar 10 '09 #1
1 2139
KevinADC
4,059 Expert 2GB
Your example is logically reversed, it should be:

Expand|Select|Wrap|Line Numbers
  1.  
  2.     if (-e $filename)
  3.     {
  4.         print "File Exists!";
  5.     }     
  6.  

-e works on Windows.
Mar 10 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Marc H. | last post by:
Hello, I recently converted one of my perl scripts to python. What the script does is simply search a lot of big mail files (~40MB) to retrieve specific emails. I simply converted the script...
6
by: Pierre-Yves | last post by:
Hello, I would like to prevent my perl program to be executed several times simultaneously (if the program is already running, I would like to display a message like "another instance of this...
3
by: Jason Miles | last post by:
Hi, I wrote this little script to check to see if our Lotus Notes servers are running, and from the command line it works fine if I type perl notescheck.pl When I invoke the script from a web...
1
by: Christina | last post by:
How can I do a simple asp check to verify if a physical file exsists on the server or not? Christina
1
by: Harry | last post by:
Hi, just getting started on ASP.NET and C# and MS-SQL. Ive managed to get all the connections working and database intergrated nicely for content and stuff. I now want to include a user...
14
by: Martin Wells | last post by:
When I have errors in a program, whether they be compiler errors, linker errors, or if the program crashes when running, I have a list of things I check for initially. If I get an error for...
4
by: Ryderch | last post by:
Greetings folks! I need to open a file located on a remote machine running DOS (ouch!) from a client running Vista. The network connection is based on NetBEUI. Test1 Code running on the...
0
by: Ed | last post by:
I want to know when the screensaver has kicked in on my monitor so that I can turn off the desk light in my office. Under XP it has worked great. I use the following to check if screensaver is...
3
by: Nimion | last post by:
Sorry if I posted in the wrong forum, but since I'm looking at VB code I have a 50/50 chance at being wrong. :) I've been trying a variety of methods to speed up the checking for duplicates. ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.