I'm searching for an easy way to organize your Anime and Manga collection. Something like this
./anime "The Melanch*" + The Melancholy of Suzumiya Haruhi Episode 110 -> Episode 111
If it doesn't exist yet, code it for me, you are prog after all.
Name:
Anonymous2009-09-28 10:27
>>61
Right, but if you notice inotify actually is able to return you relative paths too, so that number does not suffice if the path is too long. You should be using PATH_MAX + sizeof (struct inotify_event) to be completely on the safe side.
/*
struct inotify_event {
int wd; // Watch descriptor
uint32_t mask; // Mask of events
uint32_t cookie; // Unique cookie associating related
events (for rename(2))
uint32_t len; // Size of name field
char name[]; // Optional null-terminated name
};
*/
#define WRITE_LOG "inotify.log"
int main(int argc, char **argv) {
int *pfd, watch_fd[10], i, iev = inotify_init();
struct inotify_event *s;
size_t sn = sizeof *s + FILENAME_MAX; /* should be path max */
ssize_t n;
FILE *log;
clock_t t;