Skip to main content
Participant
February 4, 2013
Question

virtual directory for file object not work

  • February 4, 2013
  • 1 reply
  • 560 views

In Server.xml  write

<Security>

      <!-- Enables virtual directory mappings for file objects in the script. -->

      <!-- This is disabled by default.                                                   -->

      <VirtualDirectoryForFile enable="true"></VirtualDirectoryForFile>

in Application.xml  write

<ScriptEngine>

     <FileObject>

    <VirtualDirectory>/logs;/opt/adobe/ams/applications/konsultant/logs</VirtualDirectory>

  </FileObject>

<!-- This specifies the max size (Kb.) the runtime can grow to before -->

<!-- garbage collection is performed.                                 -->

<RuntimeSize>20480</RuntimeSize>

</ScriptEngine>

Directory  logs  exists

If  write  the file in  /logs/file.xml

var fn = "/logs/"+room_name+".xml";

flog = new File(fn);

flog.open("utf8", "create,write");

flog.write(xml_data);

flog.flush(); //row 199

flog.close();

in log application

Sending error message: /opt/adobe/ams/applications/konsrec/main.asc: line 199: Error: File operation flush failed.

Please, help me!

    This topic has been closed for replies.

    1 reply

    February 5, 2013

    "File operation flush failed." error is seen if the file is not opened. So, first confirm that the file is open as File.open() function returns a boolean value indicating whether the file opened successfully (true) or not (false).

    Also, confirm that the user or process owner that the server is running under in the operating system is having write permissions for the folder "/opt/adobe/ams/applications/konsultant/logs".

    viclightAuthor
    Participant
    February 5, 2013

    Thank you very much! You helped me a lot!

    Sincerely, Victor