shithub: npe

ref: 10d8d4ff5dad3dc3a62eefba9d6abfa8243fb348
dir: /libnpe/stat.c/

View raw version
#include <unistd.h>

#undef stat

int
npe_stat(char *filename, struct npe_stat *buf)
{
	Dir *d;

	if((d = dirstat(filename)) == nil)
		return -1;

	buf->st_size = d->length;
	buf->st_mode = d->mode;
	buf->st_mtime = d->mtime;
	free(d);

	return 0;
}