Added sys lock on file func in process.c, switched switch to enums