2
3
Fork
You've already forked ncsu
0

deletion does not work with binary export files #247

Open
opened 2024年11月21日 01:16:15 +01:00 by daxue · 2 comments
daxue commented 2024年11月21日 01:16:15 +01:00 (Migrated from code.blicky.net)
Copy link

Hi,

I used command ncdu -e -O ncdu.out folder/ to make binary export file ncdu.out, which can be read by command ncdu --enable-delete -e -f ncdu.out. The file size and writing/loading speed of binary export files is much better compared to text export files. However, deletion key d does not work and it showed File deletion is not available when reading from file. I tried the latest version 2.7 and the result is same. Text export files do not have this problem. Do you have a plan to implement the deletion function for binary export files? Thank you.

Hi, I used command `ncdu -e -O ncdu.out folder/` to make binary export file `ncdu.out`, which can be read by command `ncdu --enable-delete -e -f ncdu.out`. The file size and writing/loading speed of binary export files is much better compared to text export files. However, deletion key `d` does not work and it showed `File deletion is not available when reading from file`. I tried the latest version 2.7 and the result is same. Text export files do not have this problem. Do you have a plan to implement the deletion function for binary export files? Thank you.
yorhel commented 2024年11月21日 07:25:36 +01:00 (Migrated from code.blicky.net)
Copy link

Yes... kinda... maybe. There's technical challenges to solve to make deletion and refresh work with the binary export format. I can think of 3 possible approaches:

  1. Import the entire directory tree into RAM, i.e. treating it as a regular JSON import. Downside is that this is just as slow and uses just as much RAM as using the JSON format.
  2. Keep track of modifications to the tree in memory.
  3. Write modifications back to the binary export file.

(1) is super easy to implement and would solve the problem for most users. (2) and (3) are much better, but I have no clue how to make that work with hard link counting at the moment.

As a silly workaround, (1) can already be achieved through a JSON conversion:

ncdu -f export.ncdu -eo- | ncdu -ef- --enable-delete
Yes... kinda... maybe. There's technical challenges to solve to make deletion and refresh work with the binary export format. I can think of 3 possible approaches: 1. Import the entire directory tree into RAM, i.e. treating it as a regular JSON import. Downside is that this is just as slow and uses just as much RAM as using the JSON format. 2. Keep track of modifications to the tree in memory. 3. Write modifications back to the binary export file. (1) is super easy to implement and would solve the problem for most users. (2) and (3) are much better, but I have no clue how to make that work with hard link counting at the moment. As a silly workaround, (1) can already be achieved through a JSON conversion: ``` ncdu -f export.ncdu -eo- | ncdu -ef- --enable-delete ```
yorhel commented 2024年11月21日 07:32:05 +01:00 (Migrated from code.blicky.net)
Copy link

Actually, there's a 4th option I forgot to mention, if deletion is all you need: A deferred-deletion approach where you first mark entries to be deleted, then have an option to batch-delete them when exiting ncdu. This way the directory tree does not have to be updated for browsing.

Actually, I kinda want such a feature anyway, as it also solves #97 and combines well with #165 and #215.

Actually, there's a 4th option I forgot to mention, if deletion is all you need: A deferred-deletion approach where you first mark entries to be deleted, then have an option to batch-delete them when exiting ncdu. This way the directory tree does not have to be updated for browsing. Actually, I kinda want such a feature anyway, as it also solves #97 and combines well with #165 and #215.
Sign in to join this conversation.
No Branch/Tag specified
zig
zig0.16
master
zig-threaded
openat
chdir
clear
compll
v2.9.3
v2.9.2
v2.9.1
v2.9
v2.8.2
v2.8.1
v2.8
v1.22
v1.21
v2.7
v2.6
v2.5
v1.20
v2.4
v1.19
v2.3
v1.18.1
v2.2.2
v1.18
v2.2.1
v2.2
v1.17
v2.1.2
v2.1.1
v2.1
v2.0.1
v2.0
v2.0-beta3
v2.0-beta2
v2.0-beta1
v1.16
v1.15.1
v1.15
v1.14.2
v1.14.1
v1.14
v1.13
v1.12
v1.11
v1.10
v1.9
v1.8
v1.7
v1.6
v1.5
v1.4
v1.3
v1.2
v1.1
No labels
1.x
2.x
bug
feature
imported
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
selfisekai/ncsu#247
Reference in a new issue
selfisekai/ncsu
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?