I tried to add this piece of code after the "rcnt = read(fd,buf,st.st_size);" in conf.c
int fd2;
fd2 = open("A/CHDK/test.CFG", O_RDWR | O_CREAT, 0777);
write(fd2, buf, st.st_size);
close(fd2);
to see what's in the buffer. The buffer is empty or contains just jpg filenames. Looks like it's a problem with the read() or open() function.