Re: [PHP] unlink()?

2010-06-06 Thread tedd
At 1:02 AM +0100 6/6/10, Ashley Sheridan wrote: On Sat, 2010-06-05 at 18:55 -0400, tedd wrote: Hi gang: Never-mind. I didn't change the parent directory permissions to unlink the file -- duh! tedd I was just about to mention this! It's one of the bizarre security loopholes in Linux. If

Re: [PHP] unlink()?

2010-06-06 Thread Ashley Sheridan
On Sun, 2010-06-06 at 14:08 -0400, tedd wrote: At 1:02 AM +0100 6/6/10, Ashley Sheridan wrote: On Sat, 2010-06-05 at 18:55 -0400, tedd wrote: Hi gang: Never-mind. I didn't change the parent directory permissions to unlink the file -- duh! tedd I was just about to mention this!

Re: [PHP] unlink()?

2010-06-05 Thread Richard Quadling
On 5 June 2010 23:45, tedd t...@sperling.com wrote: Hi gang: I use unlink() to delete files on my server by using the statement: unlink($filename); where $filename is the physical path to the file plus file name, such as: $filename = '/var/www/vhosts/domain.com/httpdocs/a-dir/a-text.txt';

[PHP] unlink()?

2010-06-05 Thread tedd
Hi gang: Never-mind. I didn't change the parent directory permissions to unlink the file -- duh! Cheers, tedd --- I asked: Hi gang: I use unlink() to delete files on my server by using the statement: unlink($filename); where $filename is the physical path to the file plus file name, such

Re: [PHP] unlink()?

2010-06-05 Thread Ashley Sheridan
On Sat, 2010-06-05 at 18:55 -0400, tedd wrote: Hi gang: Never-mind. I didn't change the parent directory permissions to unlink the file -- duh! Cheers, tedd --- I asked: Hi gang: I use unlink() to delete files on my server by using the statement: unlink($filename);

[PHP] unlink file rights problem

2009-01-28 Thread Merlin Morgenstern
Hi there, I am trying to unlink a file which is inside a folder that is not writable to phps user www. Of course this failes, but I need to find a solution for it. Backgroud is following: I have pure-ftpd installed where user directories get created by pure-ftpd. Unfortunatelly there seems

RE: [PHP] PHP unlink Permission Error

2009-01-14 Thread Alice Wei
Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 17:07:34 + On Tue, 2009-01-13 at 11:49 -0500, Alice Wei wrote: Subject: RE: [PHP] PHP unlink Permission Error From

RE: [PHP] PHP unlink Permission Error

2009-01-14 Thread Ashley Sheridan
On Wed, 2009-01-14 at 07:48 -0500, Alice Wei wrote: Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 17:07:34 + On Tue, 2009-01-13 at 11:49 -0500, Alice Wei wrote

[PHP] PHP unlink Permission Error

2009-01-13 Thread Alice Wei
Hi, I have a snippet of code as follows: ?php ini_set('display_errors', 1); error_reporting(E_ALL); $curDir = getcwd(); echo $curDir; chmod($curDir,0777); unlink(testFile.txt); echo unlink(testFile.txt); chmod ($curDir,0755); ? The problem is that I do not seem to have the correct

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
On Tue, 2009-01-13 at 09:42 -0500, Alice Wei wrote: Hi, I have a snippet of code as follows: ?php ini_set('display_errors', 1); error_reporting(E_ALL); $curDir = getcwd(); echo $curDir; chmod($curDir,0777); unlink(testFile.txt); echo unlink(testFile.txt); chmod

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Alice Wei
(testFile.txt) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\project\file_write.php n line 11If this is the case, how come I don't have the permissions to delete the file? Thanks again. Alice Subject: Re: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
Subject: Re: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 14:53:32 + On Tue, 2009-01-13 at 09:42 -0500, Alice Wei wrote: Hi, I have a snippet of code as follows: ?php

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Alice Wei
Hi, Ashley: I tried to find your corrected errors, but I cannot seem to find it. Have you sent me an empty reply message by mistake? Alice Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread ceo
Not only do you need to check the return value of chmod to see if it worked, but also, I *think*: The file withing the directory can have entirely different permissions, and making the directory world writable won't help that, I don't think... I could be wrong, and a 000 file in a 777 dir

[PHP] PHP unlink Errors

2009-01-13 Thread Alice Wei
Hi, I have a snippet below that I would like to delete a file. However, I keep getting kicked out because of permission errors, when my folder permission is 0777. ?php ini_set('display_errors', 1); error_reporting(E_ALL); $curDir = getcwd(); chmod($curDir,0777) or die (Failed to

Re: [PHP] PHP unlink Errors

2009-01-13 Thread Marc
Do you have php_safe_mode enabled? If's that's the case, try turning it off and then run your script again. Alice Wei wrote: Hi, I have a snippet below that I would like to delete a file. However, I keep getting kicked out because of permission errors, when my folder permission is 0777.

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread Shawn McKenzie
\file_write.php on line 10Warning: unlink(testFile.txt) [function.unlink]: Permission denied in C:\Inetpub\wwwroot\project\file_write.php n line 11If this is the case, how come I don't have the permissions to delete the file? Thanks again. Alice Subject: Re: [PHP] PHP unlink Permission Error

RE: [PHP] PHP unlink Errors

2009-01-13 Thread Alice Wei
+0100 From: li...@bithub.net To: aj...@alumni.iu.edu CC: php-general@lists.php.net Subject: Re: [PHP] PHP unlink Errors Do you have php_safe_mode enabled? If's that's the case, try turning it off and then run your script again. Alice Wei wrote: Hi, I have a snippet below that I would like

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
snip/ No, we tend to bottom-post on this list. It's just how we roll... Ash www.ashleysheridan.co.uk

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
On Tue, 2009-01-13 at 15:46 +, c...@l-i-e.com wrote: Not only do you need to check the return value of chmod to see if it worked, but also, I *think*: The file withing the directory can have entirely different permissions, and making the directory world writable won't help that, I

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Alice Wei
University, Master of Information Science Application Programmer ProCure Treatment Centers, Inc.420 N. Walnut St.Bloomington, IN 47404812-330-6644 (office)812-219-5708 (mobile)alice@procurecenters.com(email)http://www.procurecenters.com/index.php (web) Subject: RE: [PHP] PHP unlink

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread ceo
touch foo.txt chmod 000 foo.txt rm foo.txt rm: remove write-protected regular empty file `foo.txt'? So the behaviour is at least partially shell/profile dependent... I have no idea how this would affect PHP unlink, if at all. ymmv naiaa ianasg [*] [*] sg: shell guru -- PHP

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
) http://www.procurecenters.com/index.php (web) __ Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 16:36:36

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Alice Wei
Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 16:50:31 + On Tue, 2009-01-13 at 11:33 -0500, Alice Wei wrote: Hi, Ashley:Sorry. To answer the question from your

RE: [PHP] PHP unlink Permission Error

2009-01-13 Thread Ashley Sheridan
On Tue, 2009-01-13 at 11:49 -0500, Alice Wei wrote: Subject: RE: [PHP] PHP unlink Permission Error From: a...@ashleysheridan.co.uk To: aj...@alumni.iu.edu CC: php-general@lists.php.net Date: Tue, 13 Jan 2009 16:50:31 + On Tue, 2009-01-13 at 11:33 -0500, Alice Wei wrote

Re: [PHP] PHP unlink Permission Error

2009-01-13 Thread VamVan
Alice, I see that you are using windows. For windows only the write permission for the folder and file isn't enough. You need to change the owner ship of the file as well so that u have privilege to delete. Do this , this might work: //Change the owner ship of the file to a non existent user in

[PHP] unlink oddity

2008-06-12 Thread Valuelynk.Com
Ok, here is my problem. Using the code below, I am saving a posted form to a database including the files it contains. There is one line commented out.. The unlink command. Without the command, the script works fine and new files Overwrite the old files when uploaded. If, however, I uncomment

Re: [PHP] unlink oddity

2008-06-12 Thread Chris
function saveRecord ($db,$POST) { $bd = /absolute_path_to_document_root; $fp = /path_to_files_from_document_root/; $ud = $bd . $fp; snip $path = $ud.$file; // absolute path to newly named file if ($fail || !$name || !$temp) continue; //

Re: [PHP] Unlink file older then 7 days

2007-07-20 Thread Richard Lynch
Did you actually READ my previous post that you replied to?... On Wed, July 18, 2007 1:29 am, [EMAIL PROTECTED] wrote: Ok thanks everyone... I need to throw in a wildcard, how would I do that.. I have this so far. which dont work. ? $filename = '/home/public_html/client/test/*.txt.asc';

Re: [PHP] Unlink file older then 7 days

2007-07-18 Thread chris
)) { unlink($filename); unlink($filename2); } ? Thankyou - Original Message - From: Richard Lynch [EMAIL PROTECTED] To: Stut [EMAIL PROTECTED] Cc: Suhas Pharkute [EMAIL PROTECTED]; [EMAIL PROTECTED]; php-general@lists.php.net Sent: Wednesday, July 18, 2007 2:17 AM Subject: Re: [PHP

Re: [PHP] Unlink file older then 7 days

2007-07-18 Thread Paul Scott
On Wed, 2007-07-18 at 07:29 +0100, [EMAIL PROTECTED] wrote: I need to throw in a wildcard, how would I do that.. I have this so far. which dont work. foreach(glob(*.asc.txt) as $files) { unlink($files); } --Paul All Email originating from UWC is covered by disclaimer

Re: [PHP] Unlink file older then 7 days

2007-07-17 Thread Richard Lynch
On Mon, July 16, 2007 8:40 am, Stut wrote: Suhas Pharkute wrote: http://us.php.net/manual/en/function.fileatime.php $filename = 'somefile.txt'; if (file_exists($filename) fileatime($filename) (time()-(7*24*60*60)) ) { unlink($filename); } Read docs! You too! The OP wanted a way

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread chris
How would I use fileatime to check if the file is older then 7 days? I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt --

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Stut
[EMAIL PROTECTED] wrote: How would I use fileatime to check if the file is older then 7 days? You want filemtime not fileatime. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Suhas Pharkute
http://us.php.net/manual/en/function.fileatime.php $filename = 'somefile.txt'; if (file_exists($filename) fileatime($filename) (time()-(7*24*60*60)) ) { unlink($filename); } Read docs! Suhas On 7/16/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How would I use fileatime to check if

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Stut
Suhas Pharkute wrote: http://us.php.net/manual/en/function.fileatime.php $filename = 'somefile.txt'; if (file_exists($filename) fileatime($filename) (time()-(7*24*60*60)) ) { unlink($filename); } Read docs! You too! The OP wanted a way to check the age of all files. The fileatime

Re: [PHP] Unlink file older then 7 days

2007-07-16 Thread Ray
-Original Message- From: [EMAIL PROTECTED] To: php-general@lists.php.net Date: Mon, 16 Jul 2007 14:25:47 +0100 Subject: Re: [PHP] Unlink file older then 7 days How would I use fileatime to check if the file is older then 7 days? something like: $access = fileatime (c:\path

[PHP] Unlink file older then 7 days

2007-07-14 Thread chris
I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt Thanks Chris -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Unlink file older then 7 days

2007-07-14 Thread Ray
On Saturday 14 July 2007 9:16:06 pm [EMAIL PROTECTED] wrote: I have a directory with .txt and .txt.asc files. What I want to do is.. Check the age of all files ending in .txt.asc and if the file *.txt.asc is older then 7 days delete thatfile.txt.asc and also thatfile.txt look at these

Re: [PHP] unlink before imagepng?

2007-06-20 Thread Brian Dunning
Can do, but I would be calling clearstatcache() very often, many times per second, as often as these graphics are being edited. Would that still be appropriate for the server? On Jun 19, 2007, at 8:07 AM, Greg Donald wrote: On 6/17/07, Brian Dunning [EMAIL PROTECTED] wrote: If I write an

Re: [PHP] unlink before imagepng?

2007-06-20 Thread Greg Donald
On 6/20/07, Brian Dunning [EMAIL PROTECTED] wrote: Can do, but I would be calling clearstatcache() very often, many times per second, as often as these graphics are being edited. Would that still be appropriate for the server? I certainly wouldn't use it if I didn't need it. -- Greg Donald

Re: [PHP] unlink before imagepng?

2007-06-19 Thread Greg Donald
On 6/17/07, Brian Dunning [EMAIL PROTECTED] wrote: If I write an edited image back to disk using imagepng, is it desirable to first unlink the existing image? It's not required. I notice that it works fine if I don't. Just wondering if there are any pros or cons. Just be sure and call

[PHP] unlink before imagepng?

2007-06-17 Thread Brian Dunning
If I write an edited image back to disk using imagepng, is it desirable to first unlink the existing image? I notice that it works fine if I don't. Just wondering if there are any pros or cons. - Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
Thank you for checking on this. I am using debain stable with a 2.6.14.3 kernel. The filesystem in question is ext2 on a 48 MB ramdisk. I also did the following on another machine using ext2 on a harddisk with command line php. I just ran the test with php4 cli and it works correctly. PHP

Re: [PHP] unlink, symlink and caching

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 08:29:53AM -0700, jgmtfia Mr wrote: Thank you for checking on this. I am using debain stable with a 2.6.14.3 kernel. The filesystem in question is ext2 on a 48 MB ramdisk. I also did the following on another machine using ext2 on a harddisk with command line

Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
I just ran the test with php4 cli and it works correctly. PHP 4.3.10-15 (cli) (built: May 9 2005 08:54:56) But with php5 cli and apache2 module it does not: PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19) PHP 5.1.0 apache module The versions I ran the tests were on: PHP

Re: [PHP] unlink, symlink and caching

2005-12-22 Thread Curt Zirzow
On Thu, Dec 22, 2005 at 02:41:40PM -0700, jgmtfia Mr wrote: I just ran the test with php4 cli and it works correctly. PHP 4.3.10-15 (cli) (built: May 9 2005 08:54:56) But with php5 cli and apache2 module it does not: PHP 5.1.0b3 (cli) (built: Oct 18 2005 16:13:19) PHP 5.1.0

Re: [PHP] unlink, symlink and caching

2005-12-22 Thread jgmtfia Mr
Be sure to include the OS, filesystem type and the configure line in the report, cause there seems to be something system dependent causing it since the script you posted earlier worked fine on my system. Thanks for your help. I appreciate it. -- PHP General Mailing List

[PHP] unlink, symlink and caching

2005-12-21 Thread jgmtfia Mr
I have a directory with the files: /config/A /config/B and /config/C is a symlink to /config/A. Via php I unlink /config/C: $FILE = '/config/C'; while(file_exists($FILE)){ unlink($FILE); clearstatcache(); } When

Re: [PHP] unlink, symlink and caching

2005-12-21 Thread Curt Zirzow
On Wed, Dec 21, 2005 at 11:27:23AM -0700, jgmtfia Mr wrote: I have a directory with the files: /config/A /config/B and /config/C is a symlink to /config/A. Via php I unlink /config/C: $FILE = '/config/C'; while(file_exists($FILE)){

Re: [PHP] unlink, symlink and caching

2005-12-21 Thread jgmtfia Mr
The loop then continues forever with file_exists() returning true, but unlink() returns false with the error message Warning: unlink(/config1/C) [function.unlink]: No such file or directory in /www/script.php on line 10 This might be an issue with the OS or Filessystem. The code works

[PHP] unlink images

2004-11-26 Thread Julian
Hello, I would like to delete a set of images right after they are displayed on the page using unlink. Unfortunately, with unlink the images are deleted before they display on the user's browser. Is there a way to do this? Thank you! -- PHP General Mailing List (http://www.php.net/) To

RE: [PHP] unlink images

2004-11-26 Thread Vail, Warren
Vail -Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: Friday, November 26, 2004 11:14 AM To: [EMAIL PROTECTED] Subject: [PHP] unlink images Hello, I would like to delete a set of images right after they are displayed on the page using unlink. Unfortunately

RE: [PHP] unlink images

2004-11-26 Thread Mike
, November 26, 2004 2:14 PM To: [EMAIL PROTECTED] Subject: [PHP] unlink images Hello, I would like to delete a set of images right after they are displayed on the page using unlink. Unfortunately, with unlink the images are deleted before they display on the user's browser. Is there a way

Re: [PHP] unlink images

2004-11-26 Thread Jason Wong
On Saturday 27 November 2004 03:13, Julian wrote: I would like to delete a set of images right after they are displayed on the page using unlink. I'm curious to know why you want this. Unfortunately, with unlink the images are deleted before they display on the user's browser. Is there a

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave, Nope... Didn't work. Didn't return an error or anything, didn't delete the folders either! On 8/23/04 8:21 PM, Richard Whitney [EMAIL PROTECTED] wrote: Let me clarify: system() is like working in a shell rm -rf forces removal of the directory $file_dir, which you define

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave, Trust me I do... I double checked it actually.. On 8/24/04 1:41 PM, Richard Whitney [EMAIL PROTECTED] wrote: Dumb question - are you sure you got the path right? i.e. /home/public_html/rest/of/your/path On Tue, 24 Aug 2004 13:31:06 -0400, PHP Junkie [EMAIL PROTECTED] wrote: Ave,

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread John Nichel
PHP Junkie wrote: Ave, Nope... Didn't work. Didn't return an error or anything, didn't delete the folders either! If you cannot delete via the php functions or via system calls, then you have a permission problem. What user/group is Apache running as? What is the output of 'ls -al' for the files

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread Jason Wong
Please do not top post. On Wednesday 25 August 2004 01:31, PHP Junkie wrote: Ave, Nope... Didn't work. Didn't return an error or anything, didn't delete the folders either! system('rm -rf',$user_dir,$ret_val); That should be: system(rm -rf $user_dir, $ret_val); -- Jason Wong -

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave, Apache to the best of my knowledge runs as nobody by default and since I didn't change any settings, it is probably running as nobody. This is what I got with ls -al rahul:/Library/WebServer/Documents/informed-sources.com/imsafm bob$ ls -al total 16 drwxrwxrwx5 nobody nobody170 24

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread John Nichel
PHP Junkie wrote: Ave, Apache to the best of my knowledge runs as nobody by default and since I didn't change any settings, it is probably running as nobody. This is what I got with ls -al rahul:/Library/WebServer/Documents/informed-sources.com/imsafm bob$ ls -al total 16 drwxrwxrwx5 nobody

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave, IT WORKS!!! I guess it was the syntax which was the problem! Finally it works!! system(rm -rf $user_dir, $ret_val); Works perfectly... Removes folder! Thanks a TON! On 8/24/04 2:04 PM, Jason Wong [EMAIL PROTECTED] wrote: Please do not top post. On Wednesday 25 August 2004 01:31,

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread PHP Junkie
Ave, IT WORKS!!! I guess it was the syntax which was the problem! Finally it works!! system(rm -rf $user_dir, $ret_val); Works perfectly... Removes folder! Thanks a TON! On 8/24/04 2:04 PM, Jason Wong [EMAIL PROTECTED] wrote: Please do not top post. On Wednesday 25 August 2004 01:31,

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread Jason Wong
Please stop top posting. On Wednesday 25 August 2004 02:20, PHP Junkie wrote: Apache to the best of my knowledge runs as nobody by default and since I didn't change any settings, it is probably running as nobody. Instead of speculating, find out for certain by using phpinfo(). -- Jason Wong

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread William Moore
The reason this works is because you are doing a recursive remove of the directory. The PHP rmdir() does not remove a directory with contents in it. If you modify your script so that it walks the users directory and removes each file and subdirectory then it would probally have worked correctly.

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread Jason Wong
On Wednesday 25 August 2004 02:30, John Nichel wrote: This is what I got with ls -al rahul:/Library/WebServer/Documents/informed-sources.com/imsafm bob$ ls -al total 16 drwxrwxrwx5 nobody nobody170 24 Aug 13:55 . drwxrwxrwx 102 bob unknown 3468 24 Aug 11:23 ..

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread John Nichel
Jason Wong wrote: snip If Apache is running as nobody/nobody, it does not have permission to delete these directories. The only users who can delete these directories are the respective users, and root. You need to have write permission to delete... drwxr-xr-x3 www www 102 24 Aug

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread Jason Wong
On Wednesday 25 August 2004 05:31, John Nichel wrote: How so? Even if 'nobody' is in the www group, it still wouldn't have the proper permissions. To be able to delete directories, you need: - 'wx' on the parent directory - 'rx' on the target directory To be able to delete files, you

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-24 Thread Curt Zirzow
* Thus wrote Jason Wong: Please do not top post. On Wednesday 25 August 2004 01:31, PHP Junkie wrote: Ave, Nope... Didn't work. Didn't return an error or anything, didn't delete the folders either! system('rm -rf',$user_dir,$ret_val); That should be: system(rm -rf

[PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave, I do not really know what the problem is because I don't get an error, and in fact my scripts execute fine... Except that, niether is the directory deleted, nor is the file deleted. Only corresponding database entries are deleted which I specify in my SQL code. There are 2 different

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread John Nichel
PHP Junkie wrote: Again, no error... The entries in the table get deleted.. But file remains in the directory. Any suggestions? Neither of these functions return an error. They will return false on failure. Does the user/group which your web server is running as have permission to remove these

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave, How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? Thanks. On 8/23/04 12:08 PM, John Nichel [EMAIL PROTECTED] wrote:

RE: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jay Blanchard
[snip] How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? [/snip] For security reasons Apache typically runs as nobody --

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jonathan Haddad
PHP probably does not have permission to change those files. chmod 777 and it should work. However now those files are writable by anyone. If you're on a shared server there could be problems later. Jon PHP Junkie wrote: Ave, I do not really know what the problem is because I don't get an

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread John Nichel
PHP Junkie wrote: Ave, How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? Default setup? Probably nobody/nobody. Check

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave, Well here's my situation... You see the File Manager allows users to Upload files ... Once a user uploads the file... It resides in a particular folder on my server. Users will be constantly uploading, downloading, deleting files. I can't possibly CHMOD 777 all the time... My question is...

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jonathan Haddad
the chmod 666 sets the exisiting files to be edited by the server. anything that's uploaded by the server is owned by it, and thusly can be edited. as a side note, you'd have to chmod 777 the directory to be edited if you want uploads to work. PHP Junkie wrote: Ave, Well here's my

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave, I do have the original permission set to CHMOD 777 thus the uploads are working fine. I had presumed that anything uploaded by the server is owned by it thus I wouldn't have to interfere with the permissions thereafter... But somehow that doesn't seem to be working out. I did actually set

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jason Wong
On Tuesday 24 August 2004 00:34, PHP Junkie wrote: How do I find out which user/group my web server is running as? I'm running an Apache Web Server on my Power MAC G5 (Mac OS X) machine. I can change the user/group permissions... But which user/group does the web server use? phpinfo() is

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread John Nichel
Jason Wong wrote phpinfo() is your friend. I thought phpinfo() was *MY* friend??? ;) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
I guess phpinfo() is *OUR* friend!! Great guy! Although I'd be happier if my files folders started getting deleted with the script, which still ain't happening. On 8/23/04 2:32 PM, John Nichel [EMAIL PROTECTED] wrote: Jason Wong wrote phpinfo() is your friend. I thought phpinfo() was

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jason Wong
On Tuesday 24 August 2004 02:32, John Nichel wrote: Jason Wong wrote phpinfo() is your friend. I thought phpinfo() was *MY* friend??? ;) Don't worry it's a one-to-many relationship. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread Jason Wong
On Tuesday 24 August 2004 01:55, PHP Junkie wrote: I do have the original permission set to CHMOD 777 thus the uploads are working fine. I had presumed that anything uploaded by the server is owned by it thus I wouldn't have to interfere with the permissions thereafter... But somehow that

Re: [PHP] unlink() rmdir() ... Problems.

2004-08-23 Thread PHP Junkie
Ave, Richard... What exactly did you mean by this? system('rm -rf',$user_dir,$ret_val); I don't understand. On 8/23/04 12:11 PM, Richard Whitney [EMAIL PROTECTED] wrote: system('rm -rf',$user_dir,$ret_val); On Mon, 23 Aug 2004 11:57:35 -0400, PHP Junkie [EMAIL PROTECTED] wrote: Ave,

[PHP] unlink(), why doesn't it delete the file????

2004-07-20 Thread Scott Fletcher
I have a file that was 25 KB and I use the unlink() to remove the file. When I rechecked it, I found that the file is still there but it's filesize is 0 KB. Is unlink() suppose to remove the file or what?? FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] unlink(), is it suppose to delete file???

2004-07-20 Thread Scott Fletcher
I have a file that was 25 KB and I use the unlink() to remove the file. When I rechecked it, I found that the file is still there but it's filesize is 0 KB. Is unlink() suppose to remove the file or what?? FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] unlink(), is it suppose to delete file???

2004-07-20 Thread Miroslav Hudak (php/ml)
This could happpen when the file is open by another process,... then file is deleted, but filename is still there until the file is not free of any open filedescriptors... I don't know exactly what processes happens in kernel when deleting the file, but it's something like that... and it could

RE: [PHP] unlink(), why doesn't it delete the file????

2004-07-20 Thread Jay Blanchard
[snip] I have a file that was 25 KB and I use the unlink() to remove the file. When I rechecked it, I found that the file is still there but it's filesize is 0 KB. Is unlink() suppose to remove the file or what?? [/snip] You do not say what your OS is, but I just tested on Linux and BSD and it

Re: [PHP] unlink(), why doesn't it delete the file????

2004-07-20 Thread Scott Fletcher
See my other post on this one. I don't know, maybe a bug in M$ Outlook or something. (Whistling and looking away from the issues) :-) Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] I have a file that was 25 KB and I use the unlink() to remove the file. When

Re: [PHP] unlink(), is it suppose to delete file???

2004-07-20 Thread Scott Fletcher
Yea, got that. Fixed hte problem. Thanks Miroslav Hudak [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This could happpen when the file is open by another process,... then file is deleted, but filename is still there until the file is not free of any open filedescriptors... I

[PHP] php unlink a file - is it possible?

2003-10-08 Thread Alex Shi
Hi, How can have a php script unlink/delete a file uploaded via FTP? Usually a ftp-uploaded file belongs to the ftp user, and a php script is running by apache/nobody. Seems like there shouldn't be any way to do this...OK, my situation is that I want a php script to this: it can move bulk

Re: [PHP] php unlink a file - is it possible?

2003-10-08 Thread Evan Nemerson
Unless you change the permissions of the file, the run the FTP as nobody, run apache as the ftp user, run apache as root (can't believe I even said that... blasphemy!), etc., it shouldn't be possible. If you find a way to do it w/out any of the above, I'd suggest you email the Apache Software

[PHP] unlink problem... please help...

2003-02-26 Thread Jøran Sørbø
Hi! Im developing a site using php and mysql and need som help... The site is a simple company site and it gets products, pictures etc from the database... Everyhing worls great except deleting product images from the database, and unlink them from the directory... the code i use is: the delete

Re: [PHP] unlink problem... please help...

2003-02-26 Thread Ernest E Vogelsinger
At 16:03 26.02.2003, Jøran Sørbø spoke out and said: [snip] if (isset($delimage)) { $result=unlink('$dir_to_upload/$Photo'); $result=mysql_query( update product set Photo='nothing', miniPhoto='nothing', picture='0'

Re: [PHP] unlink problem... please help...

2003-02-26 Thread Jøran Sørbø
Hi! Ive tried to change the script sometimes now and it still dont work... i still get the error Warning: unlink() failed (No such file or directory) and it wont remove the data form the database $dir_to_upload is defined in config.php wich is included... it works just fine to display image

Re: [PHP] unlink problem... please help...

2003-02-26 Thread Ernest E Vogelsinger
At 16:42 26.02.2003, Jøran Sørbø spoke out and said: [snip] Hi! Ive tried to change the script sometimes now and it still dont work... i still get the error Warning: unlink() failed (No such file or directory) and it wont remove the data form the

Re: [PHP] unlink problem... please help...

2003-02-26 Thread Chris Hayes
At 16:42 26-2-03, you wrote: $result=unlink('$dir_to_upload/$row-Photo'); what do you get when you echo echo htmlspecialchars('$dir_to_upload/$row-Photo'); and do you use the full file path? Images accept relative links but in my experience PHP's file handling functions want the full path. --

Fw: [PHP] unlink ($files);

2003-01-09 Thread Brian T. Allen
Hi, You can use the backtick operator to delete whatever you have permissions to delete: $directory = path/*.*; `rm -rf $directory`; They aren't quotes, they are backticks (to the left of the 1 key on most keyboards). It is very useful for any command line stuff you have permissions to do.

Re: [PHP] unlink ($files);

2003-01-08 Thread Adam Voigt
Can't do wildcards like * because thats something that as I found out a few days ago, is expanded by the shell into a full command, so because your not running a shell, it can't be expanded and the raw unlink call to *.* fails because the unlink function doesn't understand wildcards. If you

Re: [PHP] unlink ($files);

2003-01-08 Thread Jason Sheets
That will usually work on Unix but will not work on Windows. Rather than executing an external program you can use PHP itself to do a recursive delete. There are examples at http://www.php.net/manual/en/function.rmdir.php if you read the user notes you will see several posts about doing this.

  1   2   >