From owner-freebsd-hackers Fri May 28 4:42:20 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 69C7015124 for ; Fri, 28 May 1999 04:42:16 -0700 (PDT) (envelope-from des@flood.ping.uio.no) Received: (from des@localhost) by flood.ping.uio.no (8.9.3/8.9.1) id NAA05658; Fri, 28 May 1999 13:40:46 +0200 (CEST) (envelope-from des) To: Brian Somers Cc: Dag-Erling Smorgrav , Sheldon Hearn , hackers@freebsd.org Subject: Re: fetch(1) / fetch(3) patchkit available References: <199905281027.LAA03381@keep.lan.Awfulhak.org> From: Dag-Erling Smorgrav Date: 28 May 1999 13:40:45 +0200 In-Reply-To: Brian Somers's message of "Fri, 28 May 1999 11:27:20 +0100" Message-ID: Lines: 34 X-Mailer: Gnus v5.5/Emacs 19.34 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brian Somers writes: > What about a non-interactive command for pushing stuff via ftp/http ? > This has always been lacking IMHO (``ftp -n < gotchas). > > I haven't actually looked at libfetch, but I would think that the > functionality should be there. Libfetch supports FTP uploads (no HTTP uploads yet, I'm afraid, but it's on the todo-list). It should be trivial to write a small app which uploads stdin to a specified URL. The following should work (modulo error checking): #include #include int main(int argc, char *argv[]) { FILE *f; int c; f = fetchPutURL(argv[1], NULL); while ((c = fgetc(stdin)) != EOF) fputc(c, f); return 0; } Needless to say, this works with file: URLs as well. DES -- Dag-Erling Smorgrav - des@flood.ping.uio.no To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message