Re: Is there a better way to do this

From: Date: Thu, 17 May 2001 01:31:46 +0000
Subject: Re: Is there a better way to do this
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53136@lists.php.net to get a copy of this message
On Thu, 17 May 2001, Christopher Heschong wrote: > on 5/16/01 5:10 PM, Richard Kurth at rkurth@pacifier.com wrote: > > [snip] > > if(file_exists("userdata")) { > > end; > > } elseif(file_exists("userdata1")) { > > copy('userdata1','userdata') ; > > system("rm userdata1"); > > end; > > } else { > > exit; > > } > > if (!file_exists("userfile")) { > if (file_exists("userdata1") { > unlink("userfile1"); > } > else { > exit; > } > } minor correction. you still need the copy. for myself, i would do it slightly differently, i'd use system("mv userdata1 userdata"); but that's just because i prefer one line to two and i don't mind if the code won't run on win32 or other OSs that don't have an rm command. if you don't mind doing it in two instructions or portability to win32 is important to you, then: { copy ('userdata1','userdata'); unlink('userdata1'); } tiger -- Gerald Timothy Quimpo tiger@kami.com http://members.xoom.com/TigerQuimpo entia non sunt multiplicanda veritas liberabit vos praetere necessitatem mene sakhet ur-seveh

« previous php.general (#53136) next »