Search notes:

Python standard library: os.scandir

import os
import datetime

dir = '.' # Note: default for scandir is current directory

with os.scandir(dir) as dirEntries:
     for dirEntry in dirEntries:
         name  = dirEntry.name
       # path  = dirEntry.path
         inode = dirEntry.inode()

         stat  = dirEntry.stat()

         ctime = datetime.datetime.fromtimestamp(stat.st_ctime).strftime('%Y-%m-%d %H:%M:%S')

         if   dirEntry.is_dir():
              type = 'dir'
         elif dirEntry.is_file():
              type = 'file'
         elif dirEntry.is_symlink():
              type = 'symlink'
         else:
              type = '?'

         print(f'{name:<25} {inode:>10} {type:<7} {ctime}')
Github repository about-python, path: /standard-library/os/scandir.py

See also

os

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758203001, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Python/standard-library/os/scandir(62): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78