File Creation Issue

suyash
2023-08-06
2024-01-04
  • suyash - 2023-08-06

    Dear all,

    I am working with 'Codesys Control For Raspberry Pi'(v 4.9.0.0) and I am facing a very strange issue-
    I am unable to create a text file. I am getting an error -"FILE_OPERATION_DENIED"(5114) during File Open.
    I am able to create a .txt file manually in the same location. I also tried giving the entire folder full read, write and modify access to all the users using - sudo chmod (my_file_path) a+rwx. Yet, still I am getting the same error. The Recipe Manager that was working fine in my previous device is also not running now.

    Best Regards,
    Suyash Thatte

     
  • eschwellinger

    eschwellinger - 2023-08-07

    use the PLClogic directory to read / write files.
    /var/opt/codesys/PLClogic/
    this is due security reasons forced to use.

     
    • suyash - 2023-08-07

      Ok, I just changed the FILE.OPEN path to "/var/opt/codesys/PLClogic/" still getting the same error. Also, I manually tried creating both a file and directory inside the above location, I am not able to create it.
      Please correct me if there is an understanding gap.

       
  • stsch - 2023-08-07

    the file path in IEC is $$PLCLogic$$ instead of /var/opt/codesys/PlcLogic

     
  • suyash - 2023-08-07

    @eschwellinger Thanks a lot for your help.
    However I am unable to understand the root cause behind the failure. The directory that I was writing the file to had rwx access to all users and groups. I had also tried creating and modifying a text file using python which was successful. Why is it failing with Codesys runtime?

    Regards,
    Suyash

     
  • eschwellinger

    eschwellinger - 2023-08-07

    because of security reason it is not allowed anymore to access files outside the IEC accsible path.

     
    • atone - 2024-01-04

      @eschwellinger does FILE.Copy fails with FILE_OPERATION_DENIED when copying outside from the IEC path for the same reason? I'm looking for a workaround to this limitation.

       
  • atone - 2024-01-04

    Found it! Set ForceIecFilePath to 0 in CODESYSControl.cfg

     

Log in to post a comment.