Blockland Forums > Modification Help
Moving an Image
lilboarder32:
--- Quote from: Ephialtes on August 06, 2010, 05:14:56 PM ---The command will not create destination directories. You'll have to make those yourself and then copy the file.
--- End quote ---
Oh wow, it works perfectly, thanks!
Truce:
--- Quote from: lilboarder32 on August 06, 2010, 05:37:30 PM ---Oh wow, it works perfectly, thanks!
--- End quote ---
If you need to dynamically create directories to copy to, use something like this:
(I've never had to do this, so there might be a function for it built into Blockland.)
--- Code: ---function createDirectory(%dir)
{
if(getSubStr(%dir,strLen(%dir) - 1,1) !$= "/")
%dir = %dir @ "/";
while(true)
{
%num++;
%path = %dir @ %num @ ".tmp";
if(!isFile(%path))
break;
}
%file = new FileObject();
%file.openForWrite(%path);
%file.close();
%file.delete();
fileDelete(%path);
}
--- End code ---