Is there any IScript Function To Delete The File Contents? (Doc ID 810403.1)

Last updated on SEPTEMBER 24, 2016

Applies to:

Oracle Communications Billing and Revenue Management - Version: 7.3.1.0.0 and later   [Release: 7.3.1 and later ]
Information in this document applies to any platform.

Goal

Trying to use fileFlush() function to delete the contents of the file.

Consider the below iScript to delete the file contents:

=================================================
String FILE_REFERENCE = "REFERENCE";
File reference;
if( fileOpen( reference, FILE_REFERENCE, "a+") == false )
{
logFormat( "ERROR: reference fileOpen() failed to log date" );
}else {
if ( fileFlush(reference) == false )
{
logStdout( "ERROR: fileFlush() failed" );
} else {
logStdout( "DEBUG: fileFlush() success" );
}

}
temp = fileWriteStr(reference,"write_str");
fileClose(reference);

}
================================================

The above code displays message as "DEBUG: fileFlush() success" , but still the file contains the
old contents.


Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms