I ported ag to win32. I dropped color syntax on windows, But It's useful.
Thanks for your work.
Porting to win32
I assume this requires cygwin? I don't have a windows machine to test it out on, but it doesn't break OS X so I'm merging it.
This patch does not require cygwin. It makes native win32 application.
Really? Wow. I didn't think windows had pthreads.
If you want, I can remove dependency for pthreads. It's possible to use native thread APIs instead of pthreads.
It looks like there's a pthreads library for windows, so it's not necessary. Good work!
I compiled this for Windows and I ran into a problem on Win7.
It seems like MapViewOfFile sometimes fails with error 5: ERROR_ACCESS_DENIED
(btw the log_error calls for _WIN32 should use GetLastError instead of strerror(errno))
This seems to be happening for random files each time I run it, and only on Win7. On XP seems to be working fine.
Do you have any idea what might be going wrong here?
@mihaifm Hmm, Can you figureout the way to reproduce?
@mihaifm I fixed issue about GetLastError() in #170
It replicates (inconsistently) when I try to search in a large directory.
If we encounter a failed memory map, I think we should attempt a simple read for the whole file into memory (valid for Unix as well).
Something like this.
It worked for me.
Is this happening on a 32-bit system of 64-bit? 32-bit can easily run out of address space when mmap()ing large files.
@ggreer on Windows 7 64bit
Fix ERROR_ACCESS_DENIED on windows #158
@mihaifm Could you please try the patch below?
@mattn very cool...that seems to take care of the problem