Dave Hewitt writes:

> >From: Enrico Forestieri <[EMAIL PROTECTED]>
> >Subject: Re: Backup failure w/ LyX 1.5.2
> >Date: Wed, 17 Oct 2007 19:37:28 +0000 (UTC)
> >
> >Dave Hewitt writes:
> > > >So you're saying you have timed backups set and, even with a valid backup
> > > >path and having the document open past the time limit, you're not getting
> > > >a backup file?
> > >
> > > Correct. Could this have something to do with the odd path that was given
> > > in the error message? LyX thought I wanted backups in 'backup' directory
> > > (which didn't exist), but the error message says:
> > >
> > > "Cannot create backup file: C:/Program Files/LyX 1.5.2/backup/C:!Documents
> > > and Settings!dhewitt!Desktop!newfile1.lyx~. Please check..."
> >This is a bug. LyX should not use a filename containing ':' on Windows.
> >The backup fails because the filename is invalid.
> >Please, report it at http://bugzilla.lyx.org/
> >--
> >Enrico
> 
> I was away for a couple days... apologies for the delay.
> 
> Yes, Paul, the backup directory is still set as C:\Program Files\LyX 
> 1.5.2\backup, and the backups now fail silently without error messages.
> 
> Enrico, I'm wondering whether the backup file path and name were just a 
> function of the folder not having been there, rather than a true bug in the 
> path that LyX was using. Obviously that's a developer question and I don't 
> have a clue. This relates to my answer to Paul - since I have no error 
> messages anymore, I don't know what path is being used. If you think that 
> LyX is still using that erred path, I can enter it in Bugzilla.

It is a true bug. When you don't specify a backup directory, LyX
stores the backup in the same directory as the file itself, appending
a ~ char to the filename. When you specify a backup directory, LyX
stores the backup in that directory using the the absolute path,
mangled by replacing / with !, as the backup name. Now, on Windows
absolute paths contain the : character, which is not replaced.
This means that LyX is storing the backup in an alternate stream
of the file named as the drive letter.

Try the following. Open a terminal and type:

echo "foo" > .\a:b
echo "bar" > .\a:c

Doing so, you just create a file named "a" in the current directory,
having an empty unnamed stream and two named streams whose content
is "foo" and "bar". Indeed, you will see that a zero-length file
named "a" exists, and if you type:

more < .\a:b

or

more < .\a:c

you will get the contents of the alternate streams of file "a".
This only works with NTFS and you should put ".\" in front of "a",
otherwise "a:b" will be interpreted as the file "b" in the current
directory of drive "a:".

-- 
Enrico

Reply via email to