FILE ACCESS Directory Problem

yue-qi-qi
2014-12-10
2016-09-22
  • yue-qi-qi - 2014-12-10

    If I had opened a directory correctly,is there a method to find out all the files(file name) and subdirectries (subdirectories name) under it ?

     
  • TimvH

    TimvH - 2014-12-10

    Yes, after you have opened the directory with File.DirOpen, you can list the files and directories with File.DirList.
    The result is a struct of type FILE_DIR_ENTRY.
    See the CAA File library for information about the struct.

    Repeat this until the result of the DirList is eError: FILE.ERROR.NO_MORE_ENTRIES. Then you have completed listing the directory.

     
  • yue-qi-qi - 2014-12-10

    Thanks

     
  • lauriollila - 2016-09-21

    DirList doesn't work properly with Ubuntu 14.04 or 16.04...seems that one of the subfolders is always transparent to function and FILE.ERROR.NO_MORE_ENTRIES is reached before it should. It works well in 12.04 but it's mandatory for us to use 14.04 or 16.04 in our current project. Seems that there was a similar issue with XP in the past: http://jira.codesys.com/browse/CDS-2107 ... DirList%22. Any ideas or workarounds?

     
  • lauriollila - 2016-09-22

    Upgraded runtime from 3.5.2. to 3.5.7 and it works well...

     

Log in to post a comment.