at master 1.1 kB view raw
1diff --git a/scandir.py b/scandir.py 2index 3f602fb..40af3e5 100644 3--- a/scandir.py 4+++ b/scandir.py 5@@ -23,6 +23,7 @@ from os import listdir, lstat, stat, strerror 6 from os.path import join, islink 7 from stat import S_IFDIR, S_IFLNK, S_IFREG 8 import collections 9+import platform 10 import sys 11 12 try: 13@@ -432,6 +433,15 @@ elif sys.platform.startswith(('linux', 'darwin', 'sunos5')) or 'bsd' in sys.plat 14 ('__d_padding', ctypes.c_uint8 * 4), 15 ('d_name', ctypes.c_char * 256), 16 ) 17+ elif 'darwin' in sys.platform and 'arm64' in platform.machine(): 18+ _fields_ = ( 19+ ('d_ino', ctypes.c_uint64), 20+ ('d_off', ctypes.c_uint64), 21+ ('d_reclen', ctypes.c_uint16), 22+ ('d_namlen', ctypes.c_uint16), 23+ ('d_type', ctypes.c_uint8), 24+ ('d_name', ctypes.c_char * 1024), 25+ ) 26 else: 27 _fields_ = ( 28 ('d_ino', ctypes.c_uint32), # must be uint32, not ulong