[wplug] Follow-up on a question that was asked during Saturday's presentation (nano vs. vi with read-only or read-disabled files)
Pat Barron
pat at lectroid.com
Mon Mar 14 11:24:11 EDT 2016
There was a question asked during the presentation on Saturday that Dan
Martin (the presenter) wanted to follow up on - he'd tried sending to
the list and had some difficulty, so I'm forwarding this on his behalf.
=======================================
Hi All,
I don't have nano installed on my laptop, so I was not able to test a
question that
Eric brought up on Saturday.
As demonstrated Sat, vi will open a read-only file and, when forced to
save, will erase
the original file (assuming "wx" on the directory), then write its
buffer to a new file
of the same name. The tell-tale signs are new owner and group, and the
new file will
be created with the user's umask settings.
With a read-disabled file, vi will start with an empty buffer
(naturally, as it can't read the
file). When you force a save, vi will delete the original file, then
create a new file of the
same name with whatever happened to be in it buffer at the time of the
save.
(Again, assuming the user has "wx" on the directory.)
Testing the same scenarios with nano, the original file will not be
overwritten, either
by ^X (exit) or ^O (writeout). To save your work, you have to write to
a new file
with either of those save methods. (Again, assuming the user has "wx"
on the
directory.)
Regards,
Dan Martin
More information about the wplug
mailing list