Created
June 5, 2015 16:17
-
-
Save sl0ki/f6b5aa72dfa4a24abc39 to your computer and use it in GitHub Desktop.
fs_event.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fsevents | |
import socket | |
TCP_IP = '127.0.0.1' | |
TCP_PORT = 5005 | |
BUFFER_SIZE = 1024 | |
MESSAGE = "Hello, World!" | |
host = 'localhost'; | |
port = 8888; | |
fSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
def onFileChange(FileEvent, t): | |
print FileEvent | |
print type(FileEvent) | |
print t | |
global fSocket | |
fSocket.sendto(FileEvent, ('192.168.59.103', 32000)) | |
stream = fsevents.Stream(onFileChange, "/Users/ruslan/Documents/", file_events=True) | |
observer = fsevents.Observer() | |
observer.schedule(stream) | |
observer.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment