RE: [PHP-GENERAL] copying files

From: Date: Mon, 26 Jun 2000 15:07:09 +0000
Subject: RE: [PHP-GENERAL] copying files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-3174@lists.php.net to get a copy of this message
Thanks for the help but that didn't seem to do the trick. I always get Warning: Unable to open 'index1.php3' for reading: No such file or directory in .... If it can see the file and print out the name once it gets a directory structure. Why can it not copy it? Thanks Ken N http://cleveland.lug.net/~rocket/ The answer is simple if you grant that ironies are like submarines; dangerous only when submerged. On Mon, 26 Jun 2000, Jason wrote: > Try one of these: > copy($file, "$newdir/$domain/".$file); > copy($file, $newdir."/".$domain."/".$file); > copy($file, "$newdir/$domain/$file"); > > The latter is probably better. I don't think you can have spaces when you > use the string concatenation operator. > > Jason > > > -----Original Message----- > > From: Ken N [mailto:kenn@pcintelligent.com] > > Sent: Monday, June 26, 2000 8:58 AM > > To: php-general@lists.php.net > > Subject: [PHP-GENERAL] copying files > > > > > > Hi, > > I have this little piece of code that seems to work fine except it > > doesn't copy the file. Other than that I know it's getting the filenames > > cause it prints the, out and it's not have trouble creating the directory > > either. any suggestions? > > > > Thanks > > //========================================= > > <?php > > echo("<B>" . "I am going to move $domain into $newdir" . > > "</B>"); > > mkdir("$newdir/$domain", 0770); > > $directory = opendir("$dir/$domain"); > > > > while ($file = readdir($directory)) > > { > > if(($file != ".") && ($file != "..")) > > { > > copy($file, "$newdir/$domain/" . $file); > > > > echo("<B>" . "I moved $file into $newdir/$domain" . > > "</B>" . "<BR>"); > > } > > } > > > > > > http://cleveland.lug.net/~rocket/ > > > > The answer is simple if you grant that ironies are like submarines; > > dangerous only when submerged. > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > _______________________________________________________ > Site Design, Hosting, and E-Commerce at www.webpipe.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#3174) next »