PHP: How can I grab a single file from a directory without scanning entire directory?

前端 未结 4 505
别跟我提以往
别跟我提以往 2020-12-29 08:59

I have a directory with 1.3 Million files that I need to move into a database. I just need to grab a single filename from the directory WITHOUT scanning the whole directory.

4条回答
  •  渐次进展
    2020-12-29 09:34

    This should do it:

    
    

    readdir

    Returns the name of the next entry in the directory. The entries are returned in the order in which they are stored by the filesystem.

提交回复
热议问题