note 81158 deleted from function.scandir by cmb

From: Date: Sun, 17 Nov 2019 09:04:48 +0000
Subject: note 81158 deleted from function.scandir by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-213117@lists.php.net to get a copy of this message
Note Submitter: SlowWalkere at gmail dot com ---- Just noticed a minor difference between scandir and readdir. When opening a directory and using readdir(), each file appears to be accessed in the process. This resets the "Last Accessed" time that you would get with fileatime(). With scandir(), the list is created and none of the files are accessed. Therefore the access times remain unchanged. I encountered this while writing a script to scan a directory and delete any file that hadn't been accessed in x time. Kind of defeated the purpose when the directory listing accessed every file...

« previous php.notes (#213117) next »