From: Johan F. <dva...@cs...> - 2003-06-26 13:40:14
|
Hello I made a very small and simple patch to ifp.c to allow for simpler uploading of files from the command line. I makes 'ifp upload' accept a path as the second argument and uses the original file name prefixed with this path as destination file name. As I keep all mp3s in a 'music' subfolder I would use it as ifp upload 01\ -\ a\ great\ song.mp3 music/ Now I don't have to write out the whole filename again, which I think is neat. I have made it as simple as possible by simply checking for a '/' at the end of the second argument as path-detection. You accomplished programmers out there would have no problems doing this yourselfs, I'm posting this for those that can't write code. HOWTO: * Remove lines 117 and 118 from 'ifp-line-0.1.1/ifp.c'. * Insert the following (at the same place, before the "fclose(f)"): // if the destination argument is a path, // just use the local file name as the destination // file name, but put the file in the path specified. if (myargv[3][strlen(myargv[3])-1] == '/') { strcpy(buf, myargv[3]); strcat(buf, myargv[2]); } else { strcpy(buf, myargv[3]); } i = ifp_upload_file(dh,buf,f); * Save the file and run 'make'. You now have the modified 'ifp' file. Hopefully, someone will have something out of this (and these over the top instructions). -- Johan Forssell - dva...@cs..., do...@bo... "It's a two-in-one schampoo, and two-in-one is a bullshit term, 'cos one is not big enough to hold two. That's why two was created." |