Skip to content

Instantly share code, notes, and snippets.

@mdippery
Created January 12, 2011 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdippery/1bb3ddeb6f41bd71d429 to your computer and use it in GitHub Desktop.
Save mdippery/1bb3ddeb6f41bd71d429 to your computer and use it in GitHub Desktop.
A class that mimics `tail -f`
//
// Created by Michael Dippery on 1/12/2011.
// Copyright 2011 Michael Dippery. All rights reserved.
//
#import <Foundation/Foundation.h>
#include <stdio.h>
@interface FileTailer : NSObject
{
FILE *in;
NSTimeInterval refresh;
}
- (id)initWithPath:(NSString *)path refreshPeriod:(NSTimeInterval)aRefresh;
- (id)initWithStream:(FILE *)fh refreshPeriod:(NSTimeInterval)aRefresh;
- (void)readIndefinitely:(void (^)(int ch))action;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment