How can I get a date and size of a file?

Plug-in and third party software discussion.
Post Reply
jack093
Posts: 1
Joined: Mon Dec 07, 2020 7:08 am

How can I get a date and size of a file?

Post by jack093 » Mon Dec 07, 2020 7:14 am

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.

void
Site Admin
Posts: 6682
Joined: Fri Oct 16, 2009 11:31 pm

Re: How can I get a date and size of a file?

Post by void » Mon Dec 07, 2020 7:34 am

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/

Post Reply