#include <dos.h>
#include <exec/types.h>
#include <exec/execbase.h>
#include <proto/dos.h>
#include <stdio.h>

#include "users.h"

extern struct ExecBase *SysBase;
#define UID_PEEKER		0xf000
#define CUID	  ((struct Process *)(SysBase->ThisTask))->pr_Pad

void write_userdata(char *file,struct User *usr,int pos)
{	LONG handle;
	UWORD uid=CUID;

	CUID=UID_SYSTEM;
	if(handle=Open(file,MODE_READWRITE))
	{	Seek(handle,pos*sizeof(struct User),OFFSET_BEGINNING);
		Write(handle,usr,sizeof(struct User));
		Close(handle);
	}
	else
		printf("Could not open %s\n",file);
	CUID=uid;
}

