On 31/12/08 03:10, John Beckett wrote:
> Ben Schmidt wrote:
>> I mustn't have tried it for longer than I thought! Or perhaps
>> Explorer is different, or an old version of Explorer is
>> different, or something...
>
> My vague recollection is that Windows has a mechanism to maintain the
> case of an existing file name. Many apps save a file (say my.txt) by
> writing to my.tmp (for example), then deleting my.txt, then renaming
> my.tmp to my.txt. I think the file system caches file names for a short
> period (even after deletion), so an attempt to write a file with a name
> that is different only in case (say My.txt) will end up with the file
> keeping the original name.
>
> You would possible see this with a "save as" to a name that is different
> only in case.
>
> However, I think the renaming mechanisms (command prompt, Explorer, API)
> have always just renamed exactly as requested.
>
> John
"Saving the name & case" of a deleted file is a concept which is new to
me. The name-with-case of an existing file is kept as that file's Long
File Name which, on a FAT filesystem, is in UTF-16le and occupies an
integer number of "slots" in a directory, where by "a slot" I mean the
space occupied by a classical DOS-like directory entry which includes
the 8.3 file name (in all caps and in ASCII, or maybe in the current
8-bit codepage), the file size, attributes, first cluster number,
modification date, etc. I think it's 32 bytes long but my memory is hazy
on this subject. (The "cluster number" is the geographical location of
the start of the file, corresponding both to an entry in the FAT, from
12 bits on an old FAT12 diskette to 32 bits on a FAT32 HDD, and to an
indivisible fixed-size group of physical records in the bulk of the disk
partition. To answer a question in an earlier post on vim_dev, I suppose
it can be regarded as the FAT equivalent of an inode.)
"Save as" to a name which differs only in case could be seen as saving
to the existing file, overwriting it, and thus reusing the existing
directory entry including the LFN. OTOH the new method introduced by
patch 7.2.076 (moving back and forth to an auxiliary "different"
filename) would, I think, destroy the "old" LFN before it had a chance
to be reused. Experiment will tell.
Best regards,
Tony.
--
WOMAN: King of the who?
ARTHUR: The Britons.
WOMAN: Who are the Britons?
ARTHUR: Well, we all are. we're all Britons and I am your king.
The Quest for the Holy Grail (Monty
Python)
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---