xach / snarf Goto Github PK
View Code? Open in Web Editor NEWURL fetcher
License: GNU General Public License v2.0
URL fetcher
License: GNU General Public License v2.0
This program is FREE SOFTWARE. See the file COPYING for details. ================== snarf version 2.0 October 1, 1998 ================== Description ----------- Snarf is a utility I wrote to retrieve documents via the http and ftp protocols. It supports http redirect, http and ftp resume, http and ftp authentication, and other neat things. Usage ----- To use snarf to download a file from an url, type "snarf <your url>". This will transfer the file from the remote location to your computer. You can have as many URLs on the command line as you want: "snarf <URL> <URL> <URL>" will download three files. By default, it saves the file with the same name it had on the remote system; if you want to change this, you can do "snarf <URL> <filename>" and it will save your URL to the filename you provide. To use the HTTP proxy feature, set the SNARF_PROXY, HTTP_PROXY, or FTP_PROXY environment variables to the address of your proxy, such as "proxy.mycompany.de:1080". If you run snarf without any arguments, it prints some usage information. Notes ----- I wrote this in three days four years ago and it was majorly klugy, but it worked, and pretty niftily. I rewrote it from scratch over the past few days and I'm pleased to say that it's much nicer and cleaner inside, and this cleanliness has made it easy to add some features I always wanted to add to the old version. Version 2.0.3: This version has a configure option of "--with-guess-winsize". This feature uses ioctl to determine what your operating system things the width of your terminal is. It's not enabled by default, because I don't know how well it works on all platforms. It's safe to enable on Linux and Solaris. If you manage to get it to work somewhere else, let me know. Email: [email protected] Snail mail: Zachary Beane, 17 Talmadge Rd., Waite, ME 04492, USA
Hi!
I'm trying to download a file which has a content-length of 2608578106 bytes (2.4 GB). When I try using snarf, I get
warning: you already have all of `indiegamethemovie-1080p-1356475247.zip', skipping
even though the local file, indiegamethemovie-1080p-1356475247.zip is empty. I believe this to be due to line 427 on http.c, which says
rsrc->outfile_size = (off_t )atoi(len_string);
I tried this line in a standalone program, as follows:
printf("%ld\n", (off_t)atoi("2608578106"));
This prints out -1686389190. I believe this is causing the condition on line 157 of file util.c to become true because the size of the file is negative.
It seems like you ought to be able to trivially fix this using atol or strtol, but in my brief testing it seemed like these returned ints and not longs. Maybe I have the compiler flags wrong or something.
Thanks for your time!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.