본문 바로가기
파이썬

파이썬 폴링없이 파일 변경 감지

by º기록 2020. 10. 4.
반응형

파일 시스템의 파일이 수정되었는지 여부를 감지하기 위해 Python 프로그램 내에서 메서드를 사용하려고합니다. 시스템의 마지막 수정 날짜를 확인하기 위해 5 초마다 무언가를 실행할 수 있다는 것을 알고 있지만, 프로그램을 반복적으로 확인하지 않고도이 작업을 수행하는 더 쉬운 방법이 있는지 궁금합니다. .

누구든지 그러한 방법을 알고 있습니까?

 

해결 방법

 


홈페이지에서 :

Pyinotify는 다음을위한 Python 모듈입니다. monitoring filesystems changes. Pyinotify relies on a Linux Kernel feature (merged in kernel 2.6.13) called inotify. inotify is an event-driven notifier, its notifications are exported from kernel space to user space through three system calls. pyinotify binds these system calls and provides an implementation on top of them offering a generic and abstract way to 이러한 기능을 조작합니다.

따라서 분명히 크로스 플랫폼이 아니며 새로운 커널 버전에 의존합니다. 그러나 내가 볼 수있는 한 커널 지원을 요구하는 것은 비 폴링 메커니즘에 대해 사실 일 것입니다.

 

참조 페이지 https://stackoverflow.com/questions/5738442

 

 

반응형

댓글