Skip to content

Notepad++ corrupts/cuts off large files #12526

@timsu100

Description

@timsu100

Description of the Issue

When editing a large file and saving it, it does get corrupted and cut off

Steps to Reproduce the Issue

Requires bash and python3 but this simple example file can easily be generated by other means

Generate example file (does need 10 GB Space)

  1. Create python script run.py
for i in range(1000):
    print("a" * 10**7)
  1. run script and redirect output to file python run.py > demofile.txt

Verify file size

$ wc -c demofile.txt
10000002000 demofile.txt

We can see file size is around 10 GB.

Edit file in Notepad++

  1. Open file in npp, do a simple edit (for example add a space to the begin of the first line). This can be a bit slow and sluggish.
  2. Save file

Verify file size again

$ wc -c demofile.txt
1410067409 demofile.txt

We can see file size is around 1.4 GB.

Expected Behavior

The file size should increase by one byte.

Actual Behavior

The file loses most of its contents, now it has only 141 lines instead of 1000.

Debug Information

Notepad++ v8.4.6 (64-bit)
Build time : Sep 25 2022 - 19:51:39
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\Users<username>\Documents\data\demofile.txt"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 10 Enterprise (64-bit)
OS Version : 21H2
OS Build : 19044.2130
Current ANSI codepage : 1252
Plugins :
ComparePlugin (2.0.2)
DSpellCheck (1.4.24)
MarkdownViewerPlusPlus (0.8.2)
mimeTools (2.8)
NppConverter (4.4)
NppExport (0.4)
TextFX (0.2.4)
XMLTools (3.1.1.13)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions