c# - Overwriting local files with remote files causes Unity Standalone Application To Freeze -


i developer using unity game engine trying overwrite local files files ftp server. using system.io.file.writeallbytes function so.

when start application , trigger code has been updated, application freeze.

in windows form, code arrives here, uses webclient instance download file, , overwrites if larger local file:

public void downloadfile (webclient webclient, string urladdress,      string location, byte[] localfile) {         webclient.proxy = null;         webclient.credentials = new networkcredential("<user>", "<pass>");         byte[] filedata = webclient.downloaddata("ftp://"+ urladdress);         /*          * download if bytes of remote file           * larger bytes of local file          */         if (filedata.length > localfile.length)         {             file.writeallbytes(location, filedata);         } } 

using filestream causes application freeze well.

filestream _filestream = new filestream(location, filemode.create, fileaccess.write); _filestream.write(filedata, 0, filedata.length); _filestream.close(); 

and tried writing files needed updating temporary folder, , using file.copy

what suppose doing overwrite files?


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -