How to edit a readonly zip file using vim?
I tried to edit a zip file and change its content using the following commands
Code:
:set modifiable Quote:
I tried to edit a zip file and change its content using the following commands :set modifiable :%s/xxA/..\//g :x! But it returned the following error W10: Warning: Changing a readonly file 55 substitutions on 10 lines Press ENTER or type command to continue After I pressed Enter nothing changed. Please guide me to solve this problem. |
A read only file is an attribute of the file. You can read the file (which is what vim did), you can make changes (which vim did), but you CANNOT write the file.
What you usually do is write to a different name. Now a zip file has compressed contents. You really can't edit the contents without first decompressing what you are going to edit. The result of "editing" a zip file is usually garbage. Unusable by zip to decompress (the checksums/decompression fails), meaningless for any use. |
But It possible from this tutorial,https://blog.silentsignal.eu/2014/01...-upload-unzip/
|
Quote:
The problem is still that the access rules to the file forbid changing the file. Change the access rules first. |
No, I dont want to create trojan . Anyway how to change the access rules. I already change it permission. But no use
|
Quote:
|
Quote:
Thanks |
And when you entered that command were you given any errors? Maybe try adding -v to get more information.
I am also confused how the link you supplied has anything to do with your topic as nowhere does it mention a read only file, zip or otherwise. |
Quote:
Please read completely that third stage about editing the zip file, In that link |
I see all the stages and the steps you have followed, however, I repeat, nowhere in the entire page does it say the zip file is read only. It only says that you are editing the zip file.
|
Just what does "ls -l" report about "your" file?
And if you are on a RH/Centos/Fedora release, what does "ls -lZ" report about the file? |
Quote:
This is result of Code:
ls -l Quote:
|
Try to 'chattr -i file'.
|
Quote:
|
Maybe vim opens the file as read only if a swap file is present and option v:swapchoice = "o" is set in vimrc
You can use ' :set noro ' to exit read only mode in vim |
All times are GMT -5. The time now is 09:15 PM. |