On Wed, 1 Jun 2011 03:17:53 +0200 Enrico Forestieri <for...@lyx.org> wrote:
> [...] > I managed to actually find a file system that does not provide for > short filenames and reproduced the problem you are reporting. For reference (in case of any further problems), reproducing my 'conditions' is relatively easy and can be done on (at least) any XP system with NTFS. Two factors needs to be taken into account: 1) Some directories does not have short names (as it appears - a lot of these); ion particular, none of the directories along the way to %TEMP% does not have short names - it can be checked easily via 'dir /x' 2) I have the creation of SFNs switched on (the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\NtfsDisa ble8dot3NameCreation contains '0', unfortunately changing this requires reboot (it wouldn't be too much of a hassle if using Virtualbox or VMWare for testing env, though) BTW it seems stupid that Windows API provides GetShortPathName while NOT providing SetShortPathName... the consequence is that I know of only two ways of recreating SFN: - under Linux, via ntfs-3g (AFAIR comand setfattr can do that on a per-file/directory basis) - under Windows, via moving and then copying and finally deleting the files on a system with a filesystem with SFN creation switched on. So, to recreate my conditions you would have to switch SFN off, reboot, then (re)create the temporary path (optionally switching TEMP to point to some different test directory, after all it is a user preference in some way), then switch it on, reboot and you're done. > As the file system I tried doesn't provide a short form neither for > the path nor for the name only (while yours seems to shorten it), I > would like that you test the attached patch (to be applied on top of > the previous one) and report back whether it works for you. Not knowing whether to apply only your second patch or to apply both of them, I tried both approaches. Both seems correct now (although with the last patch no longer see the point of invoking GetShortPathNameW), so everything seems fine on my side. Keep in mind, hovewer, that you've added to some condition "or sys.platform == 'cygwin'", which I'm unable to test. Regards, MichaĆ