Code Monkey home page Code Monkey logo

file_manager's Introduction

Timestamped Data File Manager

General c++17 License

Usage

This C++ library is used for managing timestamped datefiles (ex. sensor information) stored in a certain folder. Due to the fact that there datafile can take a lot of disc space which runing the hardware system, this Data File Manager can be used for monitoring if the total size of the datafiles exceeds a certain threshhould.

Managed files have a name struction of [prefix][timestamp][extention] (ex. telemetry_2023-11-09T10:59:26Z.mcap with telemetry_ as prefixe, 2023-11-09T10:59:26Z as timestamp and .mcap as extention). prefix and extention are optional but a valid timestamp is obligatory!!!, otherwise the file will be ignored and an error information will be generated.

Note: The timestamp in the file name is used to determine whether it's old or new. (the reason to not use embeded last file written time is to prevent file has been modified after creation)

This library provide the class TimestampedFileManager which can be initialized by giving following argument to the constructor:

  • const std::string &directory_path: the path to the directory including datefiles to be managed
  • const std::string &timestamp_format: timestamp format in the file name
  • const long long &max_size: maximum allowable size of all datafiles
  • const std::string &file_prefix: prefix in the datafile name (optional, can be just empty string)
  • const std::string &file_suffix: extension of the datafile (optional, can be just empty string)

Build from source

  1. Use cmake to build
mkdir build && cd build
cmake ..
make
  1. run ctest to see if test cases are passed.

file_manager's People

Contributors

neeyoo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.