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: Beginner:
Delete file without file-end ?

 



patrik
stranger

May 26, 2001, 3:29 AM

Post #1 of 6 (1043 views)
Delete file without file-end ? Can't Post

I got some files named like [Bla]UserName

I cant delete them with the unlink thing ?!
All the other user files is deleted with unlink but the above file wont go away.

Please HELP me =)

Excuse my pore english (im from Sweden)



randor
User

May 26, 2001, 5:24 AM

Post #2 of 6 (1040 views)
Re: Delete file without file-end ? [In reply to] Can't Post

did you look into the permissions? make sue that they are set properly...

I Hope this helps...

perl programmers don't die.. they just start writing a new script.


patrik
stranger

May 26, 2001, 6:22 AM

Post #3 of 6 (1036 views)
Re: Delete file without file-end ? [In reply to] Can't Post

Permissions ??
I thought it was the filename that did it ?
Using Win98, so all files have the same properties.

??????

Excuse the bad english
Im from Sweden ;)


mhx
Enthusiast / Moderator

May 26, 2001, 6:37 AM

Post #4 of 6 (1033 views)
Re: Delete file without file-end ? [In reply to] Can't Post

Hi Patrik,

if unlink doesn't remove the file, there must be a reason for it, and I guess unlink will fail. So try the following:

Code
$file = 'UserName'; 
unlink $file or die "cannot remove $file: $!\n";

This code either succeeds and prints nothing, or fails and prints 'cannot remove UserName:' plus the reason why the file could not be removed. Perhaps this helps you more than guessing. Wink

-- Marcus



patrik
stranger

May 28, 2001, 12:39 PM

Post #5 of 6 (1019 views)
Re: Delete file without file-end ? [In reply to] Can't Post

Thats wierd, used the above code.
It delets the file BUT gives me the error ?!?!
How come ? Well, it work anyway =)
Thanx to U all.

Excuse the bad english
Im from Sweden ;)


patrik
stranger

May 29, 2001, 11:27 PM

Post #6 of 6 (1011 views)
Re: Delete file without file-end ? [In reply to] Can't Post

Found the problem. I opened the file above the unlink
line, when i dont open the file it works great.

Excuse the bad english
Im from Sweden ;)

 
 


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

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