Jump to content

[SOLVED] usc copy a file from one directory to another.


photo

Recommended Posts

hi:

i am trying to write a assets collection tool in usc to collect all assets in one level. Now i need copy the asset to another dir. Anyone know how?

Once i finished the tool, will share.

 

Thanks

Yang

Link to comment

Using File class and readStream() should do the trick. Something like (fully untested)

File source = new File(<sourcepathname>, "rb");
File copy   = new File(<copypathname>, "wb");

source.readStream( copy, source.getSize() );

source.close();
copy.close();
Link to comment

if this is the only option. I hope this copy feature could be added in to the core library.

Another workaround way is the engine could have a external command call. in this way i can call another standalone os app from the engine. 

Link to comment
×
×
  • Create New...