Skip to content

Explicit netcdf dumper error message when trying to append to non-existant file#2565

Merged
akohlmey merged 3 commits intolammps:masterfrom
prs513rosewood:explicit_netcdf_error
Jan 29, 2021
Merged

Explicit netcdf dumper error message when trying to append to non-existant file#2565
akohlmey merged 3 commits intolammps:masterfrom
prs513rosewood:explicit_netcdf_error

Conversation

@prs513rosewood
Copy link
Contributor

@prs513rosewood prs513rosewood commented Jan 26, 2021

Summary

Previous behavior would print "at keyword requires use of 'append yes'" when trying to append to non-existant file, which was confusing. It now prints "cannot append to a non-existant file filename".

Author(s)

Lucas Frérot, Department of Physics and Astronomy, Johns Hopkins University

Licensing

By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).

Backward Compatibility

Should be ok.

Implementation Notes

I make use of utils::file_is_readable instead of access(2) from unistd.h, and use of fmt::format to print the filename.

Post Submission Checklist

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • Suitable tests have been added to the unittest tree.
  • A package specific README file has been included or updated
  • One or more example input decks are included

Further Information, Files, and Links

Previous behavior would print "at keyword requires use of 'append yes'" when
trying to append to non-existant file.
@akohlmey akohlmey added this to the Stable Release Spring 2021 milestone Jan 26, 2021
@akohlmey akohlmey self-assigned this Jan 26, 2021
@akohlmey akohlmey requested review from rbberger and sjplimp January 26, 2021 16:51
@akohlmey
Copy link
Member

@prs513rosewood thanks for the change. This looks nice. Getting rid of "unistd.h" is a good thing as will improve portability.

@akohlmey akohlmey merged commit 03e7edd into lammps:master Jan 29, 2021
@prs513rosewood prs513rosewood deleted the explicit_netcdf_error branch January 30, 2021 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants