Re: [PHP] Rename

2008-01-26 Thread Nathan Rixham
vote 2 for: mv dir1/* dir2 :) backticks! Per Jessen wrote: Pastor Steve wrote: I have been looking, but the problem is that I don¹t know what questions to ask or what to look for. I think it is a rename function. That works, but it only does one file at a time. I was looking for something

Re: [PHP] Rename

2008-01-26 Thread Nathan Nobbe
On Jan 26, 2008 3:52 AM, Nathan Rixham [EMAIL PROTECTED] wrote: vote 2 for: mv dir1/* dir2 its nice, but its platform dependent. -nathan

Re: [PHP] Rename

2008-01-26 Thread Per Jessen
Nathan Nobbe wrote: On Jan 26, 2008 3:52 AM, Nathan Rixham [EMAIL PROTECTED] wrote: vote 2 for: mv dir1/* dir2 its nice, but its platform dependent. Which surely is not that much of a drawback? (well, the OP didn't mention it anyway). /Per Jessen, Zürich -- PHP General Mailing

Re: [PHP] Rename

2008-01-25 Thread Per Jessen
Pastor Steve wrote: I have been looking, but the problem is that I don¹t know what questions to ask or what to look for. I think it is a rename function. That works, but it only does one file at a time. I was looking for something that will do all the files in the directory without needing

Re: [PHP] Rename

2008-01-24 Thread Pastor Steve
I have been looking, but the problem is that I don¹t know what questions to ask or what to look for. I think it is a rename function. That works, but it only does one file at a time. I was looking for something that will do all the files in the directory without needing to know the name of each

Re: [PHP] Rename

2008-01-24 Thread Nathan Nobbe
On Jan 24, 2008 3:51 PM, Pastor Steve [EMAIL PROTECTED] wrote: I have been looking, but the problem is that I don¹t know what questions to ask or what to look for. I think it is a rename function. That works, but it only does one file at a time. I was looking for something that will do all

Re: [PHP] Rename

2008-01-24 Thread Nathan Nobbe
here a simple little cli script that has the guts of what youre trying to accomplish. NOTE: this is not a comprehensive solution :) ?php $srcDir = $argv[1]; $destDir = $argv[2]; if(is_dir($srcDir) is_dir($destDir)) { $dirHandle = opendir($srcDir); while($curFile = readdir($dirHandle)) {

Re: [PHP] Rename

2008-01-24 Thread Al
First get an array of all the files, e.g., $fpDir is the full path to yiour dir. foreach(glob($fpDir*.*) as $file) { $filesArray[] = $file; } print_r($filesArray); //so you can see what's happening Then do a: foreach($filesArray as $file){ rename($sourceDir.$file,

Re: [PHP] Rename

2008-01-24 Thread Robert Cummings
On Thu, 2008-01-24 at 16:18 -0500, Al wrote: First get an array of all the files, e.g., That's useful for debugging, but once you know what you're doing, it's a waste of resources to accumulate the array unless you have a good reason for doing so :) Cheers, Rob. --

RE: [PHP] Rename

2008-01-24 Thread Bastien Koert
http://ca3.php.net/manual/en/function.copy.php make the manual your friend bastien Date: Thu, 24 Jan 2008 14:36:55 -0600 From: [EMAIL PROTECTED] To: php-general@lists.php.net Subject: [PHP] Rename Does anyone know if there is a way to move all the files in one directory into another?

Re: [PHP] Rename

2008-01-24 Thread Nathan Nobbe
On Jan 24, 2008 4:42 PM, Bastien Koert [EMAIL PROTECTED] wrote: http://ca3.php.net/manual/en/function.copy.php make the manual your friend rename() is much more efficient; since the original files will have to be deleted as well, with a copy approach. and i suspect rename() atomic as well.

Re: [PHP] Rename

2008-01-24 Thread Al
You obviously missed my last sentence. Once you get this working, you can put the rename() in the first foreach() loop. Don't forget to take care of exceptions. Robert Cummings wrote: On Thu, 2008-01-24 at 16:18 -0500, Al wrote: First get an array of all the files, e.g., That's useful

Re: [PHP] Rename

2008-01-24 Thread Robert Cummings
On Thu, 2008-01-24 at 18:05 -0500, Al wrote: You obviously missed my last sentence. Once you get this working, you can put the rename() in the first foreach() loop. Don't forget to take care of exceptions. Yep, sorry :) Cheers, Rob. --

Re: [PHP] Rename does not work

2007-10-20 Thread Sascha Braun | CEO @ BRAUN Networks
Both versions are PHP 5.2.4_p20070914-r2 I backchecked the rights a couple of times. There to problem does not appear. I cant really understand what is happening. On the server eaccelerator and memcache is performing its work. I believe that when I restart the apache and as well the memcache all

Re: [PHP] Rename does not work

2007-10-19 Thread Børge Holen
On Friday 19 October 2007 12:49:50 Sascha Braun | CEO @ BRAUN Networks wrote: Hi everyone, I am using the rename function on my local development system fine. But as soon as I upload the script, the rename function does not work anymore. Is there a specific compiler flag needed, to make

Re: [PHP] Rename does not work

2007-10-19 Thread Richard Heyes
Sascha Braun | CEO @ BRAUN Networks wrote: I am using the rename function on my local development system fine. But as soon as I upload the script, the rename function does not work anymore. Is there a specific compiler flag needed, to make rename work on both plattforms? You're using

RE: [PHP] rename an uploaded file.

2005-08-11 Thread Ford, Mike
On 10 August 2005 22:19, Richard Lynch wrote: You can also, in some versions, get away with having \ inside of so long as the following character isn't special: $string = C:\homedirectory\uploadedfiles\\newfile.gif; Note that the 'n' character is special (newline) but 'h' and 'u' are not

Re: [PHP] rename an uploaded file.

2005-08-10 Thread Richard Lynch
On Tue, August 9, 2005 6:16 am, Stut wrote: Colons (:) are not allowed in Windows filenames. Of course they aren't allowed in file NAMES -- Because they are an integral part of a drive letter designation such as C: which is what is being used here. There's nothing wrong with the C: part of the

Re: [PHP] rename an uploaded file.

2005-08-09 Thread Stut
Bosky, Dave wrote: I seem to be having some trouble renaming a file after uploading it. It always returns a warning message indicating I have an invalid attribute in my rename statement. snip $old = 'C:\\homedirectory\uploadedfiles\\newfile.gif'; $new =

Re: [PHP] rename

2005-06-18 Thread Richard Lynch
On Sat, June 18, 2005 3:50 am, Mister Jack said: I would like to know precisely what rename do in case of error. any link for that ? It will probably return 0 (or maybe -1) on error. It may or may not also fill in $php_errmessage (?) or whatever the variable is called. It should be documented

Re: [PHP] Rename generates level 2 warning but works

2003-12-31 Thread Lowell Allen
I have this magical script which uses rename. A visitor to the site uploads a file and I want to rename it to a timestamp. Oddly enough, the rename() function actually works, it renames the file AND then generates a level 2 warning: Error code: 2 Error message: rename() failed (No such

Re: [PHP] Rename generates level 2 warning but works

2003-12-31 Thread Roger Spears
Lowell Allen wrote: Try using $HTTP_POST_FILES['uploadedFile']['name'] instead. I wasted a bunch of time yesterday with an upload script that did not recognize files when using $_FILES, but worked fine with $HTTP_POST_FILES -- PHP 4.3.4 on Linux. Thank you for the suggestion. Unfortunately, it

Re: [PHP] Rename generates level 2 warning but works

2003-12-31 Thread Lowell Allen
Lowell Allen wrote: Try using $HTTP_POST_FILES['uploadedFile']['name'] instead. I wasted a bunch of time yesterday with an upload script that did not recognize files when using $_FILES, but worked fine with $HTTP_POST_FILES -- PHP 4.3.4 on Linux. Thank you for the suggestion.

Re: [PHP] Rename the current page

2003-10-17 Thread Grant Rutherford
Grant Rutherford wrote: Alternatively, is there some way that I could generate that file, redirect the user to it, and then delete the file again afterwards? I know how to do all of this except delete the file. Is there some way to schedule a command to be run after the script is finished?

Re: [PHP] Rename the current page

2003-10-17 Thread CPT John W. Holmes
From: Grant Rutherford [EMAIL PROTECTED] I have tried many variations of the header command, but no luck so far. It seems to work okay on Mozilla browsers but not IE. Okay, what have you actually tried? What are you using now? Have you read through _all_ of the comments on the manual page for

Re: [PHP] Rename the current page

2003-10-17 Thread Grant Rutherford
Thanks for your response, What I tried was the following: header(Content-type: text/plain); header(Content-Disposition: attachment; filename=\textfile.txt\); echo $output; This works properly on Mozilla, however the following problems occur in IE: IE version 5.50.4522.1800 - 2 dialog boxes

RE: [PHP] rename variables

2003-09-24 Thread Jennifer Goodie
I'm trying to rename some variables. first I have a function - randomize (3,4); //has created unique $numbers then I want to create a function for the renaming: renameit($sculp); //sends $sculp for the new variable name and this function (and variations) function renameit($var){ $z =

Re: [PHP] rename variables

2003-09-24 Thread Dan J. Rychlik
Global works... - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Boyd Pearson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 3:44 PM Subject: RE: [PHP] rename variables I'm trying to rename some variables. first I have a function

Re: [PHP] rename()

2003-09-11 Thread CPT John W. Holmes
From: Edward Peloke [EMAIL PROTECTED] This is probably an easy question Yep.. ;) I have an uploaded image in a temp file that I want to rename and put in another folder. I am using rename() which works fine, the problem is, I want to force an overwrite if the file already exists. [snip]

RE: [PHP] rename()

2003-09-11 Thread Edward Peloke
PROTECTED] Sent: Thursday, September 11, 2003 3:19 PM To: Edward Peloke; [EMAIL PROTECTED] Php. Net Subject: Re: [PHP] rename() From: Edward Peloke [EMAIL PROTECTED] This is probably an easy question Yep.. ;) I have an uploaded image in a temp file that I want to rename and put in another

Re: [PHP] rename failes if file name contains single quotes

2003-01-31 Thread Jason Wong
On Friday 31 January 2003 16:52, $B%X!<%s(B $B%H!<%^%9(B wrote: (B when i try to rename a file with single quote(s) in the (B file name, e.g. (B (B rename("/tmp/foo 'n bar", "/tmp/foobar"); (B (B rename fails with "there is no such file". (B whats wrong? (B (BYou probably need to

Re: [PHP] rename failes if file name contains single quotes

2003-01-31 Thread Ernest E Vogelsinger
At 09:52 31.01.2003, =?ISO-2022-JP?B?GyRCJVghPCVzGyhCIBskQiVIITwlXiU5GyhC?= said: [snip] when i try to rename a file with single quote(s) in the file name, e.g. rename(/tmp/foo 'n bar, /tmp/foobar); rename fails with there is no such file. whats wrong?

Re: [PHP] Rename an upload

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 17:30, Steve Jackson wrote: I'm trying to rename an uploaded file with the value of a select I have in the uploaded form. Can someone point me in the right direction. The PHP.net rename manual isn't helping a lot? My code: What is the problem?

RE: [PHP] Rename an upload

2002-12-11 Thread Steve Jackson
On Wednesday 11 December 2002 17:30, Steve Jackson wrote: I'm trying to rename an uploaded file with the value of a select I have in the uploaded form. Can someone point me in the right direction. The PHP.net rename manual isn't helping a lot? My code: What is the problem? I can't

Re: [PHP] Rename an upload

2002-12-11 Thread Jason Wong
On Wednesday 11 December 2002 18:55, Steve Jackson wrote: On Wednesday 11 December 2002 17:30, Steve Jackson wrote: I'm trying to rename an uploaded file with the value of a select I have in the uploaded form. Can someone point me in the right direction. The PHP.net rename manual isn't

Re: [PHP] rename()

2002-10-31 Thread rija
$_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] First once you upload file from browser using form ...input type=file name=userfile, the filename is automatically renamed by another one and put down to the upload_tmp_dir and

RE: [PHP] rename()

2002-10-31 Thread John W. Holmes
I am trying to allow the user to upload pictures. What is the best way to rename them? If I use the rename function, I have to upload the pictures to the same place as the script and then move it. ALso, if I am not sure of the extension, how can I simply rename it? Can I do multiple files

RE: [PHP] rename problem...

2001-08-09 Thread billfarr
Hi Martin, Question: who actually OWNS the document? Does it have your logname and group? If you're trying to do a rename from the server, remember that the server generally runs as apache or nobody... and to coin a phrase, nobody owns nothing. If you're trying to manipulate files in your

Re: [PHP] rename a directory

2001-07-24 Thread Tom Carter
on unix I think it should work for both.. can't say I know on windows.. also, why not try exec or system and just run the normal system command for it? - Original Message - From: Jeff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:07 PM Subject: [PHP] rename a

RE: [PHP] rename a directory

2001-07-24 Thread Corin Rathbone
Yes, rename() does work on Windows as well as on *nix. -Original Message- From: Tom Carter [mailto:[EMAIL PROTECTED]] Sent: 24 July 2001 17:54 To: [EMAIL PROTECTED]; Jeff Subject: Re: [PHP] rename a directory on unix I think it should work for both.. can't say I know on windows.. also

Re: [PHP] rename a directory

2001-07-24 Thread Jeff
Thanks! Next time I won't assume it won't work... Jeff Tom Carter wrote: on unix I think it should work for both.. can't say I know on windows.. also, why not try exec or system and just run the normal system command for it? - Original Message - From: Jeff [EMAIL PROTECTED] To:

RE: [PHP] Rename a File?

2001-07-12 Thread Adrian Ciutureanu
http://php.net/rename -Original Message- From: Randy Johnson [mailto:[EMAIL PROTECTED]] Sent: 13 iulie 2001 20:53 To: Randy Johnson; Chris Lambert - WhiteCrown Networks; [EMAIL PROTECTED] Subject: [PHP] Rename a File? How do I rename a file on Linux in PHP? Thanks Randy

Re: [PHP] Rename a File?

2001-07-11 Thread Tyler Longren
mv filename newfilename - Original Message - From: Randy Johnson [EMAIL PROTECTED] To: Randy Johnson [EMAIL PROTECTED]; Chris Lambert - WhiteCrown Networks [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 13, 2001 12:53 PM Subject: [PHP] Rename a File? How do I rename a file on

RE: [PHP] rename?

2001-02-13 Thread Maxim Maletsky
I think you can rename it by using a full path. Have you tried it yet? Cheers, Maxim Maletsky -Original Message- From: Miguel Loureiro [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 14, 2001 12:02 AM To: php-gen Subject: [PHP] rename? Hi , having a hierarchy of directories,