Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Eduardo Morras
On Wed, 5 Oct 2016 09:37:23 -0600
Warren Young  wrote:

> Windows actually has a whole pile of limitations on file names, all
> of which you could warn about in Fossil under the same argument:

Some years ago in Sqlite mailing list (2007?) there was a problem
naming Sqlite DataBases with .sdb extension under Windows, system makes
a backup of the db file each time it's modified . 

There are lots of restricted extensions on Windows too, not only on the
name.

---   ---
Eduardo Morras 
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Scott Robison
On Wed, Oct 5, 2016 at 10:03 AM, Konstantin Khomoutov <
flatw...@users.sourceforge.net> wrote:

> On Wed, 5 Oct 2016 09:37:23 -0600
> Warren Young  wrote:
>
> [...]
> > 2. Contrast almost every Unix system, where the only illegal
> > character in a file name is the forward slash.
>
> ...and NUL, I beleive.
>

Not to be confused with the DOS/Windows NUL device. :)

-- 
Scott Robison
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Konstantin Khomoutov
On Wed, 5 Oct 2016 09:37:23 -0600
Warren Young  wrote:

[...]
> 2. Contrast almost every Unix system, where the only illegal
> character in a file name is the forward slash.

...and NUL, I beleive.

[...]
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread ApexVitality
Unsubscribe me from this list or any other lists I didn't ask to join
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Warren Young
On Oct 5, 2016, at 8:59 AM, Richard Hipp  wrote:
> 
> On 10/5/16, Warren Young  wrote:
>> 
>> If your repository has such file names in it, working around the
>> Windows limitation in Fossil just boots the problem a few squares down the
>> sidewalk, where it will be stumbled upon shortly by some other tool.
> 
> For this reason, the current fix is simply to output a more helpful
> error message that tries to explain the situation.
> 
> Probably we also need to also fix Fossil so that it doesn't give up
> and die when it encounters an error like this but instead at least
> tried to check out all the other files.  Perhaps there should also be
> warnings when one does "fossil add" or "fossil mv" to create a
> disallowed filename on unix - a warning to say that this will work
> fine on unix but will fail when you move the change to windows.

I’m okay with warnings, but that’s as far as it should go.  I don’t want to see 
Fossil adopting least-common-denominator policies that prevent those of us who 
have repos that never touch Windows from being limited by Windows.

(I currently use a program on Mac OS X that enforces such restrictions, and 
it’s seriously annoying.)

Windows actually has a whole pile of limitations on file names, all of which 
you could warn about in Fossil under the same argument:

- You can’t have a dot at the end of a file name. [1]

- There are a whole raft of illegal characters: < > : " / \ | ? and * plus 
ASCII 0 thru 31  [2]

- NTFS and FAT are case-insensitive in everyday use.  Therefore, Fossil 
arguably should warn on any operation that would create a collision on 
case-insensitive file systems. [3]



——

Asides:

1. This is an ancient limitation inherited from DOS and FAT, where a dot at the 
end meant you wanted a file with no extension, which wasn’t legal until Windows 
NT came around.  CMD.EXE and Explorer seem to just eat the dot when you try to 
create such a file.  Cygwin can create an “a.” file, but then Notepad barfs if 
you try to open it, thinking you meant “a.txt” and Explorer fails to delete it, 
claiming it couldn’t find the file.  Such are the problems of attempting to 
support files with a dot at the end on Windows.

2. Contrast almost every Unix system, where the only illegal character in a 
file name is the forward slash.  Mac OS X is the only common exception, also 
disallowing colon because it was the path separator in Classic Mac OS, which 
carries over into OS X today via HFS+, and historically via Rosetta.  I expect 
that limitation is going away with APFS, but that’s just speculation.

3. Also applies to HFS+ on Mac OS X.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Richard Hipp
On 10/5/16, Warren Young  wrote:
>
> Agreed.  If your repository has such file names in it, working around the
> Windows limitation in Fossil just boots the problem a few squares down the
> sidewalk, where it will be stumbled upon shortly by some other tool.

For this reason, the current fix is simply to output a more helpful
error message that tries to explain the situation.

Probably we also need to also fix Fossil so that it doesn't give up
and die when it encounters an error like this but instead at least
tried to check out all the other files.  Perhaps there should also be
warnings when one does "fossil add" or "fossil mv" to create a
disallowed filename on unix - a warning to say that this will work
fine on unix but will fail when you move the change to windows.


>
> That said, if y’all decide to support AUX and such on Windows anyway, I
> wrote some code to do this recently, just to prove a point on
> unix.stackexchange.com. :)
>
>   http://pastebin.com/rTs88KmD
>
> The code is written for the NUL case, but it’s the same for AUX, CON, etc.
>
> If someone wants to use that as a basis for a Fossil patch, the code is
> currently licensed under cc-by-sa 3.0.  That may be liberal enough to
> include it in Fossil as-is.
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>


-- 
D. Richard Hipp
d...@sqlite.org
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-05 Thread Warren Young
On Oct 4, 2016, at 2:52 PM, Ross Berteig  wrote:
> 
> On 10/4/2016 12:40 PM, Andy Bradford wrote:
>> Thus said Richard Hipp on Tue, 04 Oct 2016 12:15:58 -0400:
>>> Does anybody know of a reasonable work-around?
>> What  do other  VCS do?
> 
> IMHO, using namespace tricks to create the files or folders with reserved 
> names will only result in additional mysterious failures and pain for Windows 
> users. No build systems or compilers will be using those tricks, and even 
> deleting the files later becomes a problem for the user.

Agreed.  If your repository has such file names in it, working around the 
Windows limitation in Fossil just boots the problem a few squares down the 
sidewalk, where it will be stumbled upon shortly by some other tool.

That said, if y’all decide to support AUX and such on Windows anyway, I wrote 
some code to do this recently, just to prove a point on unix.stackexchange.com. 
:)

  http://pastebin.com/rTs88KmD

The code is written for the NUL case, but it’s the same for AUX, CON, etc.

If someone wants to use that as a basis for a Fossil patch, the code is 
currently licensed under cc-by-sa 3.0.  That may be liberal enough to include 
it in Fossil as-is.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Martin Gagnon
On Tue, Oct 04, 2016 at 01:40:59PM -0600, Andy Bradford wrote:
> Thus said Richard Hipp on Tue, 04 Oct 2016 12:15:58 -0400:
> 
> > Does anybody know of a reasonable work-around?
> 
> What  do other  VCS do?  Presumably  CVS, SVN,  Hg, Git,  etc. have  all
> Wsupported indows for a long time. Do they just return a sensible error?
> 

I just tried with git, seems not handled very well.

git version:
- Linux (debian 8): git version 1.9.1
- Windows: git version 2.7.4.windows.1 

Here's what I got on windows when cloning a repository from my linux
computer which contain a file named "aux.txt":

- It just clone the repository without showing any errors. 

- The aux.txt file never get created. 

- Command like "git diff" or "git status" tell me that "aux.txt"
  is missing.


- If I modify and commit aux.txt on the linux side. "git pull"
  on windows side tell me that aux.txt has change without
  reporting any errors but the file is still not created.


-- 
Martin G.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Pierpaolo Bernardi
On Tue, Oct 4, 2016 at 8:54 PM, Scott Robison  wrote:

> If we don't support it, Fossil potentially looks bad to someone for not
> creating what appear to be ordinary file names. If we do support it, Fossil
> potentially looks bad for creating files or directories that other processes
> can't interact with normally.
>
> I wouldn't mind taking a stab at it if enough people think it is worthwhile,
> but I'm not sure it is worthwhile.

BTW, tar has the same problem when unpacking in windows archives
created on other OSes.  None of the tars that I happened to use in the
years did anything special with these files: they cannot be created in
the normal way, so tar signals an error and that's it.

(Yes, aux.c happens to be a quite common file name :)
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Ross Berteig

On 10/4/2016 12:40 PM, Andy Bradford wrote:

Thus said Richard Hipp on Tue, 04 Oct 2016 12:15:58 -0400:

Does anybody know of a reasonable work-around?

What  do other  VCS do?  Presumably  CVS, SVN,  Hg, Git,  etc. have  all
Wsupported indows for a long time. Do they just return a sensible error?


When we still used CVS around here, my recollection is that it simply 
failed spectacularly due to a lack of testing returns from system calls 
that "cannot fail". It wasn't the only problem we had with CVS. We 
switched to fossil for lots of reasons, but at the time all of the other 
choices seemed to be run by people with an attitude problem about Windows.


This is one of those bugaboos that is mostly ignored by the tools, and 
that answer usually just works since eventually developers learn that 
they can't use those names.


IMHO, using namespace tricks to create the files or folders with 
reserved names will only result in additional mysterious failures and 
pain for Windows users. No build systems or compilers will be using 
those tricks, and even deleting the files later becomes a problem for 
the user.


The best action would be to make sure that the failure to write the file 
on a particular system gets a clear error message so the user knows who 
to blame, and doesn't blame fossil.


A possible work-around would be to transform the name from a reserved 
name to a working (but unexpected) name. Fossil would need to have a 
setting to control that, and likely should provide configuration of what 
transformation is done. We already do something sort of like that for 
symbolic links, so there is that precedent. Just adding a tilde to the 
basename would be enough to allow the checkout. The project's build 
system or other automation would still be broken, of course.


(A single setting could be added. If missing, fossil acts as it does 
now. If present, files that can't be opened are modified by appending 
the content of the setting to their basename. No idea what happens if 
you change that setting with a checkout open. It probably should be 
versionable. The mapping would need to apply to all of fossil's 
operations on that file or folder. This is beginning to sound like an 
iceberg-like feature. One setting implies 100s of lines of code.)


Beyond that, the list of disallowed names is probably stable enough that 
a warning on checkin could be made. But I strongly suspect the usual 
response to that warning by a *nix user will be "#$*!@ Windows, I just 
want to check in and go home" and the bad names will lurk until the 
project gets ported.


I vaguely recall hearing that there was a major open source project that 
had a folder named aux that was bit by this issue, and IIRC they 
ultimately resolved it by renaming the folder to something that worked 
on all platforms. I'm not recalling what project that was, though.


--
Ross Berteig   r...@cheshireeng.com
Cheshire Engineering Corp.   http://www.CheshireEng.com/
+1 626 303 1602
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Andy Bradford
Thus said Scott Robison on Tue, 04 Oct 2016 12:54:27 -0600:

> We could modify the Windows code to use the \\.\ prefix trick and then
> fossil could create / delete the files.  If we did that, how much pain
> would it cause to other tools and processes on the Windows system?

Whether or not they can actually use the file after Fossil creates it on
disk is  a different question, but  at least we don't  prevent them from
opening their repository.

Should Fossil employ the UNC prefix trick when creating files?

Andy
-- 
TAI64 timestamp: 400057f407c3


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Andy Bradford
Thus said Richard Hipp on Tue, 04 Oct 2016 12:15:58 -0400:

> Does anybody know of a reasonable work-around?

What  do other  VCS do?  Presumably  CVS, SVN,  Hg, Git,  etc. have  all
Wsupported indows for a long time. Do they just return a sensible error?

Andy
-- 
TAI64 timestamp: 400057f405ef


___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Ron W
On Tue, Oct 4, 2016 at 2:54 PM, Scott Robison 
wrote:
>
> We could modify the Windows code to use the \\.\ prefix trick and then
> fossil could create / delete the files. If we did that, how much pain would
> it cause to other tools and processes on the Windows system?
>
> If we don't support it, Fossil potentially looks bad to someone for not
> creating what appear to be ordinary file names. If we do support it, Fossil
> potentially looks bad for creating files or directories that other
> processes can't interact with normally.
>

This problem is not unique to Fossil. Several years ago, a (then) coworker
of mine cussed at Windows when files he added to whichever VCS his
department was using (Synergy, I think) could not be checked out on a
windows PC.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Scott Robison
On Tue, Oct 4, 2016 at 10:22 AM, Pierpaolo Bernardi 
wrote:

> On Tue, Oct 4, 2016 at 6:15 PM, Richard Hipp  wrote:
> > See https://www.fossil-scm.org/aux-test/doc/trunk/aux.md
> >
> > Apparently if a Fossil repository contains a file whose basename is
> > "aux", then an attempt to open or check-out that repo fails with an
> > error.  Only the basename needs to be "aux".  The full name can be
> > things like "src/aux.c" or "doc/aux.txt".
> >
> > Does anybody know of a reasonable work-around?
>
> According to this page, it looks like it can be done:
>
> https://blog.onetechnical.com/2006/11/16/forbidden-file-and-
> folder-names-on-windows/
>
> But in practice these are forbidden names in windows, the only
> reasonable path is to rename these files to something else.
>

We could modify the Windows code to use the \\.\ prefix trick and then
fossil could create / delete the files. If we did that, how much pain would
it cause to other tools and processes on the Windows system?

If we don't support it, Fossil potentially looks bad to someone for not
creating what appear to be ordinary file names. If we do support it, Fossil
potentially looks bad for creating files or directories that other
processes can't interact with normally.

I wouldn't mind taking a stab at it if enough people think it is
worthwhile, but I'm not sure it is worthwhile.

-- 
Scott Robison
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Ross Berteig

On 10/4/2016 9:22 AM, Pierpaolo Bernardi wrote:

On Tue, Oct 4, 2016 at 6:15 PM, Richard Hipp  wrote:

See https://www.fossil-scm.org/aux-test/doc/trunk/aux.md

Apparently if a Fossil repository contains a file whose basename is
"aux", then an attempt to open or check-out that repo fails with an
error.  Only the basename needs to be "aux".  The full name can be
things like "src/aux.c" or "doc/aux.txt".

Does anybody know of a reasonable work-around?


According to this page, it looks like it can be done:

https://blog.onetechnical.com/2006/11/16/forbidden-file-and-folder-names-on-windows/


The "official" story currently can be found here:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

The bottom line remains the same, though. Due to a long chain of 
"reasonable at the time" backward compatibility decisions, there is a 
list of names that are recognized by the Windows API and cannot be file 
names. Some of those names were defined by DOS 1.0 and inherited from 
CP/M. So that is a *long* history.


There are also ways to get around that. The blog post suggested a path 
prefixed by \\.\ would work. That might, but that prefix is documented 
for access to device drivers. There is also the \\?\ prefix, which can 
be used to get around the MAX_PATH length limit, and which sidesteps 
most parsing of the path name as a result.


The best advice is to not use those reserved names for either files or 
folders in repositories that will be used on Windows.



But in practice these are forbidden names in windows, the only
reasonable path is to rename these files to something else.


Although rare, it is possible for a suitably privileged user (likely 
through a badly thought out device driver) to create more such names.



___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users



--
Ross Berteig   r...@cheshireeng.com
Cheshire Engineering Corp.   http://www.CheshireEng.com/
+1 626 303 1602
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Pierpaolo Bernardi
On Tue, Oct 4, 2016 at 6:15 PM, Richard Hipp  wrote:
> See https://www.fossil-scm.org/aux-test/doc/trunk/aux.md
>
> Apparently if a Fossil repository contains a file whose basename is
> "aux", then an attempt to open or check-out that repo fails with an
> error.  Only the basename needs to be "aux".  The full name can be
> things like "src/aux.c" or "doc/aux.txt".
>
> Does anybody know of a reasonable work-around?

According to this page, it looks like it can be done:

https://blog.onetechnical.com/2006/11/16/forbidden-file-and-folder-names-on-windows/

But in practice these are forbidden names in windows, the only
reasonable path is to rename these files to something else.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] Files named "AUX" on Windows

2016-10-04 Thread Joerg Sonnenberger
On Tue, Oct 04, 2016 at 12:15:58PM -0400, Richard Hipp wrote:
> See https://www.fossil-scm.org/aux-test/doc/trunk/aux.md
> 
> Apparently if a Fossil repository contains a file whose basename is
> "aux", then an attempt to open or check-out that repo fails with an
> error.  Only the basename needs to be "aux".  The full name can be
> things like "src/aux.c" or "doc/aux.txt".

aux is a device name, nul and a couple of other things should trigger
the same behavior. I can't remember if there was ever a way to
workaround it. One of the funny ways to kill a Win9x installation was to
patch the io.sys and rename aux to windows...

Joerg
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users