From 86da6d4566b8433c0d628545e4551ce500ce67c8 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sun, 13 Apr 2003 18:05:32 +0000 Subject: [PATCH] added mp3read.c --- mp3read.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 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; +} + + + -- 2.39.2