Clib.fread
Hi,
We have a requirement to make a copy of file from directory for some processing needs.
We put following code to make a copy as suggested in one Oracle SR:
However, in production environment the copy of the file is not made, when the size of original file is ~ 4MB.
We have a requirement to make a copy of file from directory for some processing needs.
We put following code to make a copy as suggested in one Oracle SR:
try<br/>
{<br/>
var source = Clib.fopen(sourceName, "r");<br/>
var target = Clib.fopen(targetName, "w");<br/>
var buff;<br/>
var length;<br/>
<br/>
while((length = Clib.fread(buff, 4048, source)) != 0)<br/>
!Clib.fwrite(buff, length, target);<br/>
}<br/>
catch(e)<br/>
{<br/>
}<br/>
finally<br/>
{<br/>
Clib.fclose(source);<br/>
Clib.fclose(target);<br/>
}
However, in production environment the copy of the file is not made, when the size of original file is ~ 4MB.
0