Added read-write flag to open function in file.go and directory.go
Behaviour is unchanged from previous commit though