//Class CopyFile Begin
//Class CopyFile
//CopyRight:Writed By YunFengsheng
//Last modify time:
//Method: public boolean copy(String from_filenameString to_filename)
class CopyFile
{
public boolean copy(String fileString file)
{
try //must try and catchotherwide will compile error
{
//instance the File as file_in and file_out
javaioFile file_in=new javaioFile(file);
javaioFile file_out=new javaioFile(file);
FileInputStream in=new FileInputStream(file_in);
FileOutputStream out=new FileOutputStream(file_out);
byte[] bytes=new byte[];
int c;
while((c=inread(bytes))!=)
outwrite(bytesc);
inclose();
outclose();
return(true);//if success then return true
}
catch(Exception e)
{
Systemoutprintln(Error!);
return(false);//if fail then return false
}
}
}
//Class CopyFile Example
/*
CopyFile copy=new CopyFile();
boolean copy_ok=py(c:/hellojspc:/hello_backupjsp);
if(copy_ok)
{
outprintln(拷贝成功!);
}
else
{
outprintln(拷贝失败!);
}
*/
//Class CopyFile End