[dokuwiki] Re: io_rename doesn't work with new diretories/namespaces on Windows

  • From: Andreas Gohr <andi@xxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Tue, 15 May 2007 22:18:32 +0200

On Tue, 15 May 2007 16:13:13 +0200
"Gabriel Birke" <Gabriel.Birke@xxxxxxxxx> wrote:

> Hello!
> 
> I'm using the pagemove plugin that uses the function io_rename for
> moving the metadata files. However, if the namespace I want to move a
> page to, doesn't exist, io_rename fails. 
> 
> Example: I want to move ns1:page1 to ns2:page1. ns2 doesn't exist. The
> "rename" command in io_rename fails, then copy is tried, but "copy"
> also fails because the directory ns2 doesn't exist.
> 
> Now my question: who should be responsible for creating the directory
> before copying? Is that a task for the plugin, or is this a bug in
> io_rename? If it's no bug, then I think there should be a warning in
> the documentation comment of io_rename.

Not a bug. io_rename is a wrapper around http://php.net/rename which
will revert to copy/delete when needed. The original rename does not
create directories.

You should call io_makeFileDir with the target path/filename before
calling io_rename to make sure the target dir exists.

Andi

-- 
http://www.splitbrain.org

Other related posts: