How can I get a date and size of a file?
def search_files(file):
Search = windll.LoadLibrary("everything64.dll")
strBuff = create_unicode_buffer(255)
fdate = ctypes.c_ulonglong(1)
file_size = ctypes.c_ulonglong(1)
Search.Everything_SetSearchW(file)
Search.Everything_QueryW(True)
Results = Search.Everything_GetNumResults()
for i in range(Results):
Search.Everything_GetResultFullPathNameW(i,byref(strBuff),len(strBuff))
Search.Everything_GetResultDateModified(i,fdate) # error
Search.Everything_GetResultSize(i,file_size) # error
yield strBuff.value,fdate.value,file_size.value
del Search
del strBuff
Thanks.
How can I get a date and size of a file?
Re: How can I get a date and size of a file?
The error might be occurring in the following line:
Search.Everything_GetResultFullPathNameW(i,byref(strBuff),len(strBuff))
Please try:
Search.Everything_GetResultFullPathNameW(i,strBuff,ctypes.sizeof(strBuff))
https://www.voidtools.com/support/everything/sdk/python/
Search.Everything_GetResultFullPathNameW(i,byref(strBuff),len(strBuff))
Please try:
Search.Everything_GetResultFullPathNameW(i,strBuff,ctypes.sizeof(strBuff))
https://www.voidtools.com/support/everything/sdk/python/