#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <iostream>
#include <signal.h>

//CSE 660
//Jason Kim

using namespace std;

int main()
{
	int pide;
	pide = getpid();
	cout << "Process E starting with pid of " << pide << endl;
	int file1;
	char buf[200];
	file1 = open("XYZ.txt",O_RDONLY);
	read(file1,buf,200);
	
	//prints out XYZ in reverse order.
	int size = 200;
	while (size != 0)
	{
		cout << buf[size];
		size--;
	}
	close(file1);
	unlink("XYZ.txt"); //deletes files
	cout << endl;
	cout << "Process E terminating" << endl;
	exit(1);
	return 0;
}
		

