{"size": 4744, "ext": "js", "max_stars_repo_path": "routes/system_calls.js", "max_stars_repo_name": "smarty1palak/OS-Simulator", "max_stars_repo_stars_event_min_datetime": "2020-11-10T17:08:53.000Z", "max_stars_repo_stars_event_max_datetime": "2021-11-20T11:29:19.000Z", "max_issues_repo_path": "routes/system_calls.js", "max_issues_repo_name": "smarty1palak/OS-Simulator", "max_issues_repo_issues_event_min_datetime": "2020-07-03T08:07:53.000Z", "max_issues_repo_issues_event_max_datetime": "2020-07-03T08:07:53.000Z", "max_forks_repo_path": "routes/system_calls.js", "max_forks_repo_name": "animeshk08/os-simulator", "max_forks_repo_forks_event_min_datetime": "2018-04-15T04:48:05.000Z", "max_forks_repo_forks_event_max_datetime": "2022-01-22T17:17:30.000Z"}
{"max_stars_count": 10, "max_issues_count": 1, "max_forks_count": 9, "avg_line_length": 26.2099447514, "max_line_length": 113, "alphanum_fraction": 0.6827571669}
var express = require('express');
var exec = require('child_process').exec;
var router = express.Router();

// access() call
router.post('/access', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/access ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// alarm() call
router.post('/alarm', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/alarm ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// creat() call
router.post('/creat', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/creat ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// dup() call
router.post('/dup', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/dup ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// exit() call
router.post('/exit', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/exit ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// fork() call
router.post('/fork', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/fork ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// getid() call
router.post('/getid', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/getid ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// kill() call
router.post('/kill', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/kill ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// link() call
router.post('/link', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/link ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// lseek() call
router.post('lseek', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/lseek ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// open() call
router.post('/open', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/open ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// read() call
router.post('/read', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/read ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// unlink() call
router.post('/unlink', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/unlink ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// wait() call
router.post('/access', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/wait ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

// write() call
router.post('/write', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/write ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});
// man() call
router.post('/man', function(req,res){
	var input="";
	console.log(req.body.input);
	exec(__dirname + '/executables/system_calls/man ' + req.body.input , function callback(error,stdout,stderr) {
		console.log(stdout);
		console.log(error);
		res.send(stdout);
	});
});

module.exports=router;
