PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old June 9th, 2002, 11:59 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
unlink

why doesn't the following work? it returns "Warning: Unlink failed (No such file or directory)"
php Code:
Original - php Code
  1.  
  2. if($myHandle = opendir($myDir))
  3. {
  4.     while(FALSE !== ($file = readdir($myHandle)))
  5.     {
  6.     if($file != "." && $file != "..")
  7.     {
  8.         $myArray[] = "$file";
  9.     }
  10.     }
  11.  
  12.     if($myArray != "")
  13.     {
  14.     $total = count($myArray);
  15.  
  16.     if($total > 3)
  17.     {
  18.         $fileToDelete = reset($myArray);
  19.         unlink("$fileToDelete");
  20.     }
  21.     }
  22.     closedir($myHandle)
  23. }

Reply With Quote
  #2  
Old June 10th, 2002, 01:20 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to EvilivE
RE: unlink

drop the qoutes in: unlink("$fileToDelete");

Reply With Quote
  #3  
Old June 10th, 2002, 07:56 AM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: unlink

k it wasn't the quotes.. apparently the problem was in copying the image to start with.. for some reason using "fopen" & "fwrite" to copy a file from another server onto my own in a directory other than the script executing it caused the file to not be a valid type.

so i just copied into the same dir as my script, and then used "copy" function to get it where i wanted and all is swell

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > unlink


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway