On Mon, Aug 25, 2008 at 4:21 PM, Tony Mechelynck
<[EMAIL PROTECTED]> wrote:
>
> On 25/08/08 21:35, James Vega wrote:
>> On Mon, Aug 25, 2008 at 3:10 PM, Tony Mechelynck
> [...]
>>> - On systems where hard links are possible (including not only
>>> Unix/Linux, but also, IIUC, NTFS filesystems on Windows NT and later) a
>>> file may have more than one name (more than one directory entry,
>>> possibly in different directories but not different drives or
>>> partitions, can legally point to the same area on the disk). This case
>>> is rarer than the symlink case but it may exist, at least in theory; I
>>> don't even know whether Vim is able to detect the condition. ("Hard
>>> link" is the Unix name; the Windows name is different -- I don't know it
>>> -- but the phenomenon is the same.)
>>
>> The Windows name is "junction", if I remember right, and there's no way
>> for Vim (or anything else for that matter) to know what other files are
>> hardlinked to a specific file. You can only tell whether a file is/has
>> hardlink by checking the link count column in the output of "ls -l" (or
>> any other tool which provides such information).
>
> The question is not to determine which other files, if any, are
> hardlinked to a specific file (which might require scanning all
> directories on the whole partition the way some disk integrity checking
> programs do), it is just to determine whether two given pathfilenames
> point to the same disk area (which ought to require only a comparison of
> "where their directory entries point to").
Which is simply a subset of my general statement in my previous email.
There is no way to determine this simply from pathnames. In fact, the
only way to determine this, at least under Linux, is to check whether
they have the same inode. I'm not sure how you would do so for other
OSes.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---