Skip to main content
Participant
Feb 4, 2013 7:26 PM UTC
Question

virtual directory for file object not work

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 is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Feb 5, 2013 2:11 AM UTC

    "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".

    Translate
    viclightAuthor
    Participant
    Feb 5, 2013 1:18 PM UTC

    Thank you very much! You helped me a lot!

    Sincerely, Victor

    Translate