bitshares / bitshares/bitshares-core

Refactor fc::fstream to be more like std::fstream

Open
#1,116 1 comment 0 reactions 0 assignees Claimed by @pmconrad View on GitHub
1a Epic 2a Discussion Needed 3c Enhancement
Dominant language
C++
Stars
1.2k
Forks
660
Avg merge
8h 17m
Merged PRs (30d)
26

Description

**User Story**
As a `developer` I want `to use fc::fstream` so that `it works like most other fstream library classes/functions`.

**Impacts**
- [ ] API (the application programming interface)
- [ ] Build (the build process or something prior to compiled code)
- [ ] CLI (the command line wallet)
- [ ] Deployment (the deployment process after building such as Docker, Travis, etc.)
- [ ] DEX (the Decentralized EXchange, market engine, etc.)
- [ ] P2P (the peer-to-peer network for transaction/block propagation)
- [ ] Performance (system or user efficiency, etc.)
- [ ] Protocol (the blockchain logic, consensus, validation, etc.)
- [ ] Security (the security of system or user data, etc.)
- [ ] UX (the User Experience)
- [X] Other (please add below)

**Additional Context (optional)**
fc::fstream had a deficiency that files could not be opened in append mode. See issue #809. As part of the research for that issue, it was found that the ``mode`` parameter does not work as one would expect after working with fstream of the standard library or boost. See https://github.com/bitshares/bitshares-core/issues/809#issuecomment-402428470.

Making fc::fstream compatible with std::fstream will require careful examination of all uses, to make sure they work the same as today. We may even find uses where they are expecting it to work like std::fstream but it is not.

## CORE TEAM TASK LIST
- [ ] Evaluate / Prioritize Feature Request
- [ ] Refine User Stories / Requirements
- [ ] Define Test Cases
- [ ] Design / Develop Solution
- [ ] Perform QA/Testing
- [ ] Update Documentation

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the fc::fstream implementation and every use of it, then compare its mode behavior with std::fstream and the findings in issue #809. Inspect the open pull request #2047; done means append mode and other fstream operations behave compatibly without changing existing uses, with test cases covering the agreed behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.