Plan 9 from Bell Labs’s /usr/web/sources/plan9/sys/src/cmd/venti/srv/readifile.c

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#include "stdinc.h"
#include "dat.h"
#include "fns.h"

void
usage(void)
{
	fprint(2, "usage: readifile file\n");
	threadexitsall("usage");
}

void
threadmain(int argc, char *argv[])
{
	IFile ifile;

	ARGBEGIN{
	default:
		usage();
	}ARGEND
	
	if(argc != 1)
		usage();
	
	if(readifile(&ifile, argv[0]) < 0)
		sysfatal("readifile %s: %r", argv[0]);
	write(1, ifile.b->data, ifile.b->len);
	threadexitsall(nil);
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.