From: hackbard Date: Sun, 13 Apr 2003 18:05:32 +0000 (+0000) Subject: added mp3read.c X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86da6d4566b8433c0d628545e4551ce500ce67c8;p=my-code%2Fmp3db.git added mp3read.c --- diff --git a/mp3read.c b/mp3read.c new file mode 100644 index 0000000..dd61d86 --- /dev/null +++ b/mp3read.c @@ -0,0 +1,40 @@ +/* read mp3 info, hackbard */ + +#include +#include +#include +#include +#include +#include + +#define MAX_READ 1024 +#define MAX_FILENAME 256 + +int main (int argc,char **argv) +{ + int file_fd; /* desc fir file */ + char buf[MAX_READ]; /* buffer for the actual info */ + char filename[MAX_FILENAME]; + + strcpy(argv[1],filename); + + if((file_fd=open(filename,O_RDONLY))<=0) { + puts("open failed"); + return -23; + } + + if((read(file_fd,&buf,MAX_READ))<=MAX_READ) { + puts("read failed"); + return -23; + } + + printf(" -> %s",buf); + + puts(""); + puts("done"); + + return 23; +} + + +