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

[PHP] Rename

2008-01-24 Thread Pastor Steve
Does anyone know if there is a way to move all the files in one directory into another? Thanks, -- Steve M.

Re: [PHP] Rename

2008-01-24 Thread Pastor Steve
Original Message Date: Thursday, January 24, 2008 02:36:55 PM -0600 From: Pastor Steve [EMAIL PROTECTED] To: PHP eMail List 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 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
-0600 From: Pastor Steve [EMAIL PROTECTED] To: PHP eMail List 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? Thanks, -- Steve M. -- End Original Message -- -- PHP General Mailing List

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

[PHP] Rename does not work

2007-10-19 Thread Sascha Braun | CEO @ BRAUN Networks
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 rename work on both plattforms? Thank you very much. Sascha -- PHP General

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

[PHP] rename an uploaded file.

2005-08-09 Thread Bosky, Dave
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. Thanks, Dave --- Example: $old = 'C:\\homedirectory\uploadedfiles\\newfile.gif'; $new =

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 =

[PHP] rename

2005-06-18 Thread Mister Jack
Hi, I would like to know precisely what rename do in case of error. any link for that ? I do a : @rename($old, $new), what happens if I run out of space ? is the rename just an alias for C function library ? thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

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

[PHP] rename() on NT

2004-10-13 Thread Jed R. Brubaker
Can this be done when the file already exists? cleong at organic dot com says 29-Mar-2000 04:36 rename() doesn't seem to overwrite files on NT. The behavior is an OS-dependent side-effect I guess. on the PHP site @ http://us2.php.net/manual/en/function.rename.php So this this true, or is

[PHP] Rename generates level 2 warning but works

2003-12-31 Thread Roger Spears
Hello, 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

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.

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

2003-12-31 Thread Roger Spears
Lowell Allen wrote So, I think you need to pass rename parameters that are file locations. HTH -- Lowell Allen Thank you!!! I was not in tune to what was happening. You are correct. You must pass file locations and not just file namesonce I passed the locations, the warning went

[PHP] Rename the current page

2003-10-17 Thread Grant Rutherford
Hi there, I would like a user to request the page view_file.php, and I would like php to generate an arbitrary file and send it to the user. This is all okay, however, I would like to rename the sent page so that the browser doesn't open it in a window as an html file but instead brings up

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

[PHP] rename variables

2003-09-24 Thread Boyd Pearson
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 = 1;

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

[PHP] rename()

2003-09-11 Thread Edward Peloke
This is probably an easy question but I have been looking at this code for a while and it is all blurry..:) 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

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

[PHP] rename failes if file name contains single quotes

2003-01-31 Thread $B%X!<%s(B $B%H!<%^%9(B
when i try to rename a file with single quote(s) in the (Bfile name, e.g. (B (Brename("/tmp/foo 'n bar", "/tmp/foobar"); (B (Brename fails with "there is no such file". (Bwhats wrong? (B (Bthanx, (B (Bakagisan (B (B__ (BDo You Yahoo!?

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?

[PHP] Rename an upload

2002-12-11 Thread Steve Jackson
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: //Form for upload form enctype=multipart/form-data action=eshop_upload.php method=post input

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
figure out how to upload the file with the name I need. The rename function in the manual says Its: rename(string1,string2) Ie. ?php rename(/tmp/tmp_file.txt, /home/user/login/docs/my_file.txt); ? I want to rename the file copied to the server to the name of the select value I sent in my

Re: [PHP] Rename an upload

2002-12-11 Thread Jason Wong
helping a lot? My code: What is the problem? I can't figure out how to upload the file with the name I need. The rename function in the manual says Its: rename(string1,string2) Ie. ?php rename(/tmp/tmp_file.txt, /home/user/login/docs/my_file.txt); ? I want to rename the file

[PHP] rename()

2002-10-31 Thread Edward Peloke
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 at

Re: [PHP] rename()

2002-10-31 Thread rija
']['type'] or $_FILES['userfile']['name'] using php function like eregi() for example- - Original Message - From: Edward Peloke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, November 01, 2002 9:25 AM Subject: [PHP] rename() I am trying to allow the user to upload pictures. What

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

[PHP] rename problem...

2001-08-09 Thread Martin
Hi! When i'm trying to run this script: ? rename(document.htm, testing.htm); ? I get this error: Warning: Rename failed (Permission denied) in C:\Inetpub\WEBS\mysko\uploads\rename.php on line 4 The directoy has change permissions. What am i donig wrong...? /martin -- PHP General Mailing

RE: [PHP] rename problem...

2001-08-09 Thread billfarr
other considerations. Best regards, Bill -Original Message- From: Martin [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 09, 2001 7:20 AM To: [EMAIL PROTECTED] Subject: [PHP] rename problem... Hi! When i'm trying to run this script: ? rename(document.htm, testing.htm); ? I get

[PHP] rename a directory

2001-07-24 Thread Jeff
Does anyone know how to rename a directory? There is rename() for files but I couldn't find anything for directories... Thanks, Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the

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

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
] To: [EMAIL PROTECTED] Sent: Tuesday, July 24, 2001 6:07 PM Subject: [PHP] rename a directory Does anyone know how to rename a directory? There is rename() for files but I couldn't find anything for directories... Thanks, Jeff -- PHP General Mailing List (http://www.php.net

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

[PHP] Rename a File?

2001-07-11 Thread Randy Johnson
How do I rename a file on Linux in PHP? Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

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

[PHP] rename?

2001-02-13 Thread Miguel Loureiro
Hi , having a hierarchy of directories, like A\b\d, A\c, I would like to move directory A\b\d to A\c\d , to (try) to get it I test something like rename(d,".. / c/d"), but I get " Warning: Rename failed (No such file or directory) in ", it's necessary create the directory first, I mean ,

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