[SERVER-7497] refactor and rationalize mongo/util/file.h, move code to new mongo/util/file.cpp Created: 28/Oct/12  Updated: 11/Jul/16  Resolved: 13/Dec/12

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.3.0
Fix Version/s: 2.3.2

Type: Improvement Priority: Major - P3
Reporter: Tad Marshall Assignee: Tad Marshall
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-7933 Linux open() with O_NOATIME can fail Closed
Backwards Compatibility: Fully Compatible
Participants:

 Description   

The source code file mongo/util/file.h contains a File class based on a FileInterface class that is not used by any other derived class. All code for the File class is in the header file; there is no file.cpp. The code for Windows and non-Windows versions of the member functions do not align well; they print different messages on errors and in one case one version throws an massert while the other just logs a message. Neither version does a very good job of logging what failed on some errors. There is some code that might be moved into a "file" area, but it doesn't belong in a header file and so isn't easy to move.



 Comments   
Comment by auto [ 13/Dec/12 ]

Author:

{u'date': u'2012-12-13T16:04:53Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-7497 refactor and rationalize mongo/util/file.h; create file.cpp

Remove the FileInterface base class. Move the code for non-trivial members
of the File class into a new mongo/util/file.cpp. Make the behavior of
Windows and non-Windows versions of functions match. Test the return status
of every OS API and report all errors in detail.
Branch: master
https://github.com/mongodb/mongo/commit/97c43bce6d80eb7424e085150666b8d4a26faac3

Generated at Thu Feb 08 03:14:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.