ioflo / hio

Apache License 2.0
8 stars 8 forks source link

Modify reopen/remake logic so can detect if file or path already exists and so does not open #34

Open SmithSamuelM opened 5 months ago

SmithSamuelM commented 5 months ago

new .exists method allows detecting if main path/file already exists. Does not check for alternate path. So first add parameter altive=True/False to disable auto alternate path creation i.e force it to fail if main path fails due to permissions.

Now can check to see if main or alt path already exists by changing reopen/remake behavior. Add a virgin=True/False parameter to reopen/remake and some logic changes that there would be a way to make it so existing reopen/remake methods could tell if file alread ready existed because it would force it to only be opened == True if it was a virgin open (i.e. did not exist before i.e never been opened). But is was going to take more time to figure out than I had so I will come back to it later. This way can also manage the alternate path as well. Created an issue for me to do this later.