CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
How to Delete File from Machine

 



Karthik
Deleted

Dec 20, 2000, 11:37 PM

Post #1 of 5 (235 views)
How to Delete File from Machine Can't Post

Hi Guys
Can any one tell me how to delete the file by using perl from the Machine...Is there any Function...??
thanks in Advance
Karthik K



sleuth
Enthusiast / Moderator

Dec 20, 2000, 11:41 PM

Post #2 of 5 (233 views)
Re: How to Delete File from Machine [In reply to] Can't Post

 
I know the FAQ is always overlooked, but if you go Here in the FAQ You'll find the function and it's usage.

Sleuth



Karthik
Deleted

Dec 20, 2000, 11:52 PM

Post #3 of 5 (232 views)
Re: How to Delete File from Machine [In reply to] Can't Post

thanks but it is not workin
I have a file called text.txt in the same directory in which the perl file is running. But the code has no effect. how to give with Path. the full path is "E:\perl scripts\file\text.txt"
can u help me out on this
thanks
karthik



Karthik
Deleted

Dec 20, 2000, 11:53 PM

Post #4 of 5 (232 views)
Re: How to Delete File from Machine [In reply to] Can't Post

Sorry Pal it is Working well thanks
KArthik



japhy
Enthusiast

Dec 21, 2000, 7:02 AM

Post #5 of 5 (228 views)
Re: How to Delete File from Machine [In reply to] Can't Post

Windows allows you to use forward slashes from programs. So you can write


Code
unlink "E:/perl scripts/file/text.txt";

or, use single quotes:


Code
unlink 'E:\perl scripts\file\text.txt';

You should also do error checking on the function.

Jeff "japhy" Pinyan -- accomplished hacker, teacher, lecturer, and author

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives