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
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
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
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
Does anyone know if there is a way to move all the files in one directory
into another?
Thanks,
--
Steve M.
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
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
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)) {
-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
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.
--
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
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.
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
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.
--
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
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
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
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
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
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
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 =
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 =
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:
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
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
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
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
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
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.
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
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
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?
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
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
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;
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 =
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
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
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]
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
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!?
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
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?
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
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?
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
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
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
']['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
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
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
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
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
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
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
]
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
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
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]
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
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 ,
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
61 matches
Mail list logo