obhq / obliteration

Experimental PS4 emulator written in Rust for Windows, macOS and Linux
https://obliteration.net
MIT License
601 stars 17 forks source link

First try to read file, then create file if it doesn't exist. #774

Closed VocalFan closed 4 months ago

VocalFan commented 4 months ago

Fix to SuchAFuriousDeath having the fix be half-right.

Is kind of unclean, but the best we have for now. Tested to handle folders existing and not existing just fine.

Fixes #773

ultimaweapon commented 4 months ago

This is not correct because it will cause behavior different from raw_mkdir on *nix. See https://github.com/obhq/obliteration/pull/772#issuecomment-2022144486 for more details.

VocalFan commented 4 months ago

Ya say that, yet this still seems to give results :P

I mean, we reach the todo'd open function now... Instead of just erroring. Even then if the folders already existed, file_open wouldn't error and we'd reach Open anyways. But no, windows doesn't like having one type where it if file exists, read it, if not, make then read it. You have to do both.

SuchAFuriousDeath commented 4 months ago

That's not true, image

VocalFan commented 4 months ago

That's not true, image

...Damn, I'll redo this then lmao-

SuchAFuriousDeath commented 4 months ago

It will still be wrong