snow_zhangy Posted March 7, 2014 Share Posted March 7, 2014 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
ulf.schroeter Posted March 7, 2014 Share Posted March 7, 2014 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
snow_zhangy Posted March 7, 2014 Author Share Posted March 7, 2014 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
ulf.schroeter Posted March 7, 2014 Share Posted March 7, 2014 https://developer.unigine.com/en/docs/1.0/scripting/core/os#system_string Link to comment
snow_zhangy Posted March 8, 2014 Author Share Posted March 8, 2014 Thanks Ulf! I didnt notice that. Thanks Link to comment
Recommended Posts