Don't crash on unreadable files. #32

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@nex3
nex3 commented May 18, 2012

Currently, if there's an unreadable file in a directory, watching that directory will fail. This patch fixes that by treating unreadable files as nonexistent.

@thibaudgg
Member

Looks good, could you also provide some specs please? Thanks a lot!

@thibaudgg
Member

@Maher4Ever how does it sounds to you?

@Maher4Ever
Member

First off, thank you for the patch.

In Listen we only check the content of a file when creating the checksum, so that's the only place we need to stop doing it when a file is unreadable. We still could watch changes to unreadable files using the mtime, but of course multiple changes within the same second won't be caught.

@Maher4Ever
Member

@nex3 Could you please check if the new changes fix your issue?

@nex3
nex3 commented May 21, 2012

This doesn't solve it. The issue wasn't reading the file to check for changes, it was the call to File.mtime. This fails if the file is unreadable.

@Maher4Ever
Member

@nex3 On what system did you have that problem? And could you mention the specific case where reading the mtime of a file fails?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment