You are viewing a single thread.
View all comments View context
1 point

… You can’t edit files inside a zip file. The program’s just hiding that it’s decompressing and decompressing the whole thing every time you change something.

Zip files are usually just another wrapper around DEFLATE, and compressing each block requires knowledge of the previous block’s compression (Part of LZ77). It’s a streaming format, not a sparse format.

permalink
report
parent
reply
2 points
*
Removed by mod
permalink
report
parent
reply
1 point

RAR != ZIP.

Fell free to read a stack overflow about that situation

Your choices are basically “rewrite the entire file” or “leave the original file in place, do an append and try and hide the old file.”

Editing old data in most streaming file formats with inline metadata is basically impossible because they compact the data as much as possible and internally refer to offsets.

Appending is trivial, editing is very hard if not downright impossible.

permalink
report
parent
reply
1 point

If you edit a text file, it actually just creates a new file because inserting text in the middle means all of the text after changes position. I’d still call that editing an existing file rather than creating a new file based on the previous one plus some edits. The second description might be more technically accurate but it’s just unnecessary technical details because it’s effectively the first description.

Even going back to the original use of edit, editors would mark up books or articles and then a new copy would need to be created with those edits. I’m having trouble thinking of any cases where edit truly means “change something in place without making a new copy of it with the changes included”. I guess small edits with pencil or whiteout can sometimes work.

permalink
report
parent
reply

Technology

!technology@lemmy.world

Create post

This is a most excellent place for technology news and articles.


Our Rules


  1. Follow the lemmy.world rules.
  2. Only tech related content.
  3. Be excellent to each another!
  4. Mod approved content bots can post up to 10 articles per day.
  5. Threads asking for personal tech support may be deleted.
  6. Politics threads may be removed.
  7. No memes allowed as posts, OK to post as comments.
  8. Only approved bots from the list below, to ask if your bot can be added please contact us.
  9. Check for duplicates before posting, duplicates may be removed

Approved Bots


Community stats

  • 18K

    Monthly active users

  • 12K

    Posts

  • 532K

    Comments