php “glob” and data-deduplication?

前端 未结 4 2261
无人及你
无人及你 2021-02-12 17:45

I have a php-application which is (per request) scanning for the existance of some files. (on a network share)

I\'m using glob for this, cause usually i jus

相关标签:
4条回答
  • 2021-02-12 17:53

    Did you try

    $files = glob('{,.}*', GLOB_BRACE);
    

    It might be possible that the data de-dupe feature is keeping the opened file as a hidden file.

    0 讨论(0)
  • 2021-02-12 17:55

    This makes some sense if the intent of deduplication is not to have duplicates, then the files are being locked and php cant see them. The only thing to do is is see if this limitation applies to scandir() and the SPL directory/filesystem family of iterators as well. If so it may not be possible to get a list of them.

    The only other choice would be to use exec() and a windows command line sort of hack to see if you can get a list of files and then parse the output. This may be useful

    php exec: does not return output

    Good luck!

    0 讨论(0)
  • 2021-02-12 17:59

    Do you prepare to use another function than glob()? You can try to use SPL's recursive iterators if it will find an opened file that's located on a drive that's using Windows Server 2012 R2 build in data-deduplication feature. You can find an example how you can use it from this link.

    0 讨论(0)
  • 2021-02-12 18:09

    I'm not sure if this is what you're looking for but i use scandir() to list all the files in a directory, then you can excecute any command on them once you know the name. It will work on open files as well

    PHP scandir documentation source

    0 讨论(0)
提交回复
热议问题