X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fmp3db.git;a=blobdiff_plain;f=mp3read.c;fp=mp3read.c;h=dd61d86f175bf87f909fdcfa3f68ccefe2790635;hp=0000000000000000000000000000000000000000;hb=86da6d4566b8433c0d628545e4551ce500ce67c8;hpb=bd148eec81f91061deb5895223b3da80a62b8830 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; +} + + +