shithub: 9intro

ref: 87288afa5ac476efb3ef1ed40df658427339f13e
dir: /src/stat.c/

View raw version
#include <u.h>
#include <libc.h>

void
main(int , char* [])
{
	Dir*	d;

	d = dirstat("/NOTICE");
	if (d == nil)
		sysfatal("dirstat: %r");
	print("file name: %s\n", d->name);
	print("file mode: 0%o\n", d->mode);
	print("file size: %d bytes\n", d->length);
	free(d);
	exits(nil);
}