8000 Open MPCORB input file as read only by Siltala · Pull Request #163 · oorb/oorb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Open MPCORB input file as read only #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 24, 2023
Merged

Conversation

Siltala
Copy link
Collaborator
@Siltala Siltala commented May 3, 2023

PR simplified a lot to only open MPCORB as read only - this was already the case for other input files.

This PR changes the NEW subroutine in File.f90 to accept an optional argument for specifying whether to open a file as read only or in read+write mode. If it is not specified, the default is the same as the current behavior (read+write).

The second commit changes oorb.f90 to open input observation files, orbit files, and the configuration file as read only. I'm pretty sure that we don't write to input files anywhere (and output files are not changed) and from my testing so far everything still works.

This is useful for certain setups where the input data are in a folder oorb doesn't have write access to.

@mgranvik
Copy link
Collaborator
mgranvik commented May 3, 2023

@Siltala: There is already a subroutine that does exactly what you want: setActionRead(this). To use it, simply change the code from

call new(yourfile)
call open(yourfile)

to

call new(yourfile)
call setActionRead(yourfile)
call open(yourfile)

So no need to add functionality to File_class.

@Siltala
Copy link
Collaborator Author
Siltala commented May 3, 2023

Oh, thank you, I missed that. I will change the PR accordingly

@Siltala
Copy link
Collaborator Author
Siltala commented May 10, 2023

Simplified this a lot to a one liner - as per Mikael's comment above almost everything was actually being opened as read only anymore. The only exception was the MPCORB file in the mpcorb task (and I confirmed on our end that is the exact task we had the problem with).

Now this PR just has a single line added to open that as read only too.

@Siltala Siltala changed the title Open oorb input files as read only Open MPCORB input file as read only May 10, 2023
@mgranvik mgranvik merged commit 4a14a9e into oorb:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0