Skip to content

Allow zero backups #59

Closed
Closed

Description

@gabrielbrieva

It is possible to allow zero backups files?

Activity

  1. lamweili commented on Jan 9, 2022

    @lamweili
    Contributor

    I tried the following and it didn't work.

    var rollers = require('streamroller');
    var stream = new rollers.RollingFileStream('myfile', 3, 0);
    stream.write("abc");
    stream.write("def");
    stream.write("ghi");
    stream.end();

    Output:

    myfile   - ghi
    myfile.1 - def
    
  2. modified the milestones: 3.0.0, on Jan 12, 2022
  3. lamweili commented on Jan 12, 2022

    @lamweili
    Contributor

    I tried the following and it now works.

    Important
    It is also to note the file does not roll within itself (truncate its older entry for newer entry).
    It truncates all and appends only the new entry.

    var rollers = require('streamroller');
    var stream = new rollers.RollingFileStream('myfile', 6, 0);
    stream.write("abc"); // add as first row
    stream.write("def"); // add as second row
    stream.write("ghi"); // truncate all and add as first row
    stream.end();

    Output:

    myfile   - ghi
    
  4. lamweili commented on Jan 14, 2022

    @lamweili
    Contributor

    For details, refer to #74 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions