Re: Renaming a Directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-09-09 at 00:08 -0400, Paul M Foster wrote:
> On Tue, Sep 08, 2009 at 05:39:43PM -0400, Floyd Resler wrote:
> 
> > How can I rename a directory with files in it?  The rename function
> > gives me a "directory not empty" error.  I know I could do it be
> > creating the directory, moving the files, and then deleting the old
> > one.  Is there an easier way?
> 
> It sounds like, underneath, rename() is creating a new directory and
> then attempting to delete the old one, ignoring the files in the
> original directory. In which case, you'll have to do it the long way--
> create a new directory, move the files, then delete the old directory.
> 
> Oddly enough, I can't find a *nix command which will actually rename a
> directory. The man pages for mv, rename and such all refer only to
> files, not directories.
> 
> Paul
> 
> -- 
> Paul M. Foster
> 
That's because in *nix, everything is a file. Directories, devices, all
have file interfaces.

Thanks,
Ash
http://www.ashleysheridan.co.uk




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux