Saving file position in mcedit

Pavel Roskin proski at gnu.org
Fri Nov 29 10:06:40 UTC 2002


Hello!

I have tried the patch for saving file position, and indeed it seems very 
convenient.  I think it should be in 4.6.0.

I'm doing minor cleanups now.  In particular, I changed
edit_move_to_column() to be much more effective (current patch is attached
for the curious).

There is one question I want to ask.  What if we save the positions for
the device and inode combinations, rather than for filenames?  Device and
inode numbers are part of the stat structure, and they are unique for
every file.  They also survive renames.  mc already calls stat(), so we
have the required data already.

On the positive side we have less manipulations with strings in the code
(in fact, the file with positions can just be a binary) and the ability to
rename files and whole directories without losing saved positions for all
files.

On the negative side, it is harder to edit the file with positions, e.g.  
to hide the fact that you were editing certain files.  I don't think it's
important.  You can always erase the whole file to hide evidence.

Any other reasons to tie positions to full filenames?

-- 
Regards,
Pavel Roskin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: save_pos.diff.gz
Type: application/x-gzip
Size: 3703 bytes
Desc: 
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20021129/3ab08e64/attachment.bin>


More information about the mc-devel mailing list