public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* vim 64 conflict with windows slash and swapfile
@ 2019-02-20 18:16 Taylor, Kit
  2019-02-25 22:05 ` L A Walsh
  0 siblings, 1 reply; 5+ messages in thread
From: Taylor, Kit @ 2019-02-20 18:16 UTC (permalink / raw)
  To: cygwin

Don't know if this is a VIM bug or CYGWIN bug.  Probably something I have configured incorrectly.

I just cut over to Cygwin 64-bit, on Windows 10, VIM 8.0, Windows command line (not bash).
When opening a file to edit, using back slashes in the path, VIM warns "unable to open swapfile".  Swap file is not, in fact, created.
Permissions are correct, file opens, edits, saves fine.
Using the same command with forward slashes gives no error.  Using the same command, with backslashes, on 32-bit CYGWIN gives no error.

Not a large bug, but a nuisance.  Thanks.

Kit Taylor
Software Engineer, Mitsubishi Custom Controls
ktaylor@hvac.mea.com<mailto:ktaylor@hvac.mea.com>




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vim 64 conflict with windows slash and swapfile
  2019-02-20 18:16 vim 64 conflict with windows slash and swapfile Taylor, Kit
@ 2019-02-25 22:05 ` L A Walsh
  2019-02-25 23:31   ` Taylor, Kit
  2019-02-26  8:57   ` Csaba Raduly
  0 siblings, 2 replies; 5+ messages in thread
From: L A Walsh @ 2019-02-25 22:05 UTC (permalink / raw)
  To: cygwin, Taylor, Kit

On 2/20/2019 8:28 AM, Taylor, Kit wrote:
> Don't know if this is a VIM bug or CYGWIN bug.  Probably something I have configured incorrectly.
>
> I just cut over to Cygwin 64-bit, on Windows 10, VIM 8.0, Windows command line (not bash).
> When opening a file to edit, using back slashes in the path, VIM warns "unable to open swapfile".  

I'm not sure why it would be prevented from creating a .FILENAME.swp,
but paths in cygwin (and linux and posix) use '/'.  Internally at the NT
level, many of the windows libraries, '/' is accepted.  The same may
not be true of all windows libraries.  However, you should use
the '/' delimiter for the cygwin version of vim. 

Note, '\' is a character in linux/posix/cygwin meaning to quote the
next character.  So an unquoted or double quote string will get rid
of the backslashes and produce a decoded output.

If you are in bash and want to use '\', you need to either
double the backslashes (thus quoting the '\') or put the whole
string in single quotes.

From the bash manpage:
backslash-escaped characters replaced as specified by the
       ANSI C standard.  Backslash escape sequences, if present,  are 
decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \e
              \E     an escape character
              \f     form feed
              \n     new line
              \r     carriage return
              \t     horizontal tab
              \v     vertical tab
              \\     backslash
              \'     single quote
              \"     double quote
              \?     question mark
              \nnn   the  eight-bit  character  whose value is the octal
value
                     nnn (one to three digits)
              \xHH   the eight-bit character whose value  is  the 
hexadecimal
                     value HH (one or two hex digits)
              \uHHHH the  Unicode (ISO/IEC 10646) character whose value
is the
                     hexadecimal value HHHH (one to four hex digits)
              \UHHHHHHHH
                     the Unicode (ISO/IEC 10646) character whose value
is  the
                     hexadecimal value HHHHHHHH (one to eight hex digits)
              \cx    a control-x character
--------

> Swap file is not, in fact, created.
>   
Depending on the filename, if it contained any of the above escape
sequences, they'd be replaced with their indicated decoding.

> Not a large bug, but a nuisance.  Thanks.
>   
---
    Want to talk about nuisances...

    Bill Gates changed the file-system object separator from '/' to
'\' so that DOS would look less like CP/M -- a competing micro OS at
the time that copied the use of '/' from unix.  He was trying to avoid
the impression that he got the idea of using '/' to delineate file
system hierarchy as there was more concern about lawsuits by some companies
in "look-alike" interfaces. 

    Example: Apple, besides suing MS for its "Recycling Bin" as
Apple had a trashbin on their desktop with similar functionality also
sued some companies producing "lookalikes (Franklin) out of business.

    Apple eventually lost their lawsuit against MS as
interfaces became "uncopyrightable", while it was pointed out that Apple
had stolen many of its GUI concepts from Xerox who invented and
used them first -- and had demoed them to Wozniak and Jobs.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: vim 64 conflict with windows slash and swapfile
  2019-02-25 22:05 ` L A Walsh
@ 2019-02-25 23:31   ` Taylor, Kit
  2019-02-27 10:31     ` Brian Inglis
  2019-02-26  8:57   ` Csaba Raduly
  1 sibling, 1 reply; 5+ messages in thread
From: Taylor, Kit @ 2019-02-25 23:31 UTC (permalink / raw)
  To: L A Walsh, cygwin

Thanks for the response.  My curiosity about it was that 32-bit vim works fine, only 64-bit vim shows the problem (both same version, of course).
Even stranger, it doesn't happen every time.

My guess is there is an embedded path internally, which uses a separator, and the 32-bit one either does not include that path, or handles it differently.
As I say, I can live with it.  Was just hoping for an easy config fix.

I'm familiar with the path separators - been fighting that since the late 80s.  My bad for using Cygwin apps from the Windows command line, but there are compatibility issues otherwise...

Thanks.
Kit

-----Original Message-----
From: L A Walsh [mailto:cygwin@tlinx.org] 
Sent: Monday, February 25, 2019 5:00 PM
To: cygwin@cygwin.com; Taylor, Kit <ktaylor@hvac.mea.com>
Subject: Re: vim 64 conflict with windows slash and swapfile

On 2/20/2019 8:28 AM, Taylor, Kit wrote:
> Don't know if this is a VIM bug or CYGWIN bug.  Probably something I have configured incorrectly.
>
> I just cut over to Cygwin 64-bit, on Windows 10, VIM 8.0, Windows command line (not bash).
> When opening a file to edit, using back slashes in the path, VIM warns "unable to open swapfile".  

I'm not sure why it would be prevented from creating a .FILENAME.swp, but paths in cygwin (and linux and posix) use '/'.  Internally at the NT level, many of the windows libraries, '/' is accepted.  The same may not be true of all windows libraries.  However, you should use the '/' delimiter for the cygwin version of vim. 

Note, '\' is a character in linux/posix/cygwin meaning to quote the next character.  So an unquoted or double quote string will get rid of the backslashes and produce a decoded output.

If you are in bash and want to use '\', you need to either double the backslashes (thus quoting the '\') or put the whole string in single quotes.

From the bash manpage:
backslash-escaped characters replaced as specified by the
       ANSI C standard.  Backslash escape sequences, if present,  are decoded
       as follows:
              \a     alert (bell)
              \b     backspace
              \e
              \E     an escape character
              \f     form feed
              \n     new line
              \r     carriage return
              \t     horizontal tab
              \v     vertical tab
              \\     backslash
              \'     single quote
              \"     double quote
              \?     question mark
              \nnn   the  eight-bit  character  whose value is the octal
value
                     nnn (one to three digits)
              \xHH   the eight-bit character whose value  is  the 
hexadecimal
                     value HH (one or two hex digits)
              \uHHHH the  Unicode (ISO/IEC 10646) character whose value is the
                     hexadecimal value HHHH (one to four hex digits)
              \UHHHHHHHH
                     the Unicode (ISO/IEC 10646) character whose value is  the
                     hexadecimal value HHHHHHHH (one to eight hex digits)
              \cx    a control-x character
--------

> Swap file is not, in fact, created.
>   
Depending on the filename, if it contained any of the above escape sequences, they'd be replaced with their indicated decoding.

> Not a large bug, but a nuisance.  Thanks.
>   
---
    Want to talk about nuisances...

    Bill Gates changed the file-system object separator from '/' to '\' so that DOS would look less like CP/M -- a competing micro OS at the time that copied the use of '/' from unix.  He was trying to avoid the impression that he got the idea of using '/' to delineate file system hierarchy as there was more concern about lawsuits by some companies in "look-alike" interfaces. 

    Example: Apple, besides suing MS for its "Recycling Bin" as Apple had a trashbin on their desktop with similar functionality also sued some companies producing "lookalikes (Franklin) out of business.

    Apple eventually lost their lawsuit against MS as interfaces became "uncopyrightable", while it was pointed out that Apple had stolen many of its GUI concepts from Xerox who invented and used them first -- and had demoed them to Wozniak and Jobs.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vim 64 conflict with windows slash and swapfile
  2019-02-25 22:05 ` L A Walsh
  2019-02-25 23:31   ` Taylor, Kit
@ 2019-02-26  8:57   ` Csaba Raduly
  1 sibling, 0 replies; 5+ messages in thread
From: Csaba Raduly @ 2019-02-26  8:57 UTC (permalink / raw)
  To: cygwin list; +Cc: Taylor, Kit

On Mon, Feb 25, 2019 at 11:01 PM L A Walsh  wrote:

>     Bill Gates changed the file-system object separator from '/' to
> '\' so that DOS would look less like CP/M -- a competing micro OS at
> the time that copied the use of '/' from unix.  He was trying to avoid
> the impression that he got the idea of using '/' to delineate file
> system hierarchy as there was more concern about lawsuits by some companies
> in "look-alike" interfaces.

"Wrong," said Renner.

"The tactful way," Rod said quietly, "the polite way to disagree with
the Senator would be to say, `That turns out not to be the case.'"
        -- Larry Niven and Jerry Pournelle, The Mote in God's Eye


'\' was chosen for the DOS path separator because they wanted to look
*more* like CP/M, which was already using '/' as the command line switch prefix.

https://en.wikipedia.org/wiki/Path_%28computing%29#History

Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: vim 64 conflict with windows slash and swapfile
  2019-02-25 23:31   ` Taylor, Kit
@ 2019-02-27 10:31     ` Brian Inglis
  0 siblings, 0 replies; 5+ messages in thread
From: Brian Inglis @ 2019-02-27 10:31 UTC (permalink / raw)
  To: cygwin

On 2019-02-25 15:10, Kit Taylor wrote:
> Thanks for the response. My curiosity about it was that 32-bit vim works 
> fine, only 64-bit vim shows the problem (both same version, of course).
> Even stranger, it doesn't happen every time.
> My guess is there is an embedded path internally, which uses a separator, and
> the 32-bit one either does not include that path, or handles it differently.
> As I say, I can live with it. Was just hoping for an easy config fix.
> I'm familiar with the path separators - been fighting that since the late
> 80s.  My bad for using Cygwin apps from the Windows command line, but there
> are compatibility issues otherwise...

I also like to be able to run Cygwin, Debian, Ubuntu apps from cmd or mintty
command lines, or in mintty windows, and use {g}vim on local or remote systems,
so I have common dotfiles, dotdirs, and configs, and create ~/.vim/{cache/,...}
under all home directories, and add to ~/.vim/vimrc:

	" prepend ~/.vim to override rtp ~/vimfiles
	set runtimepath^=~/.vim
	set viminfo+=n~/.vim/viminfo
	set backupdir=~/.vim/cache,~/.cache/vim,/var/tmp,/usr/tmp,/tmp
	set directory=~/.vim/cache,~/.cache/vim,/var/tmp,/usr/tmp,/tmp
	set undodir=~/.vim/cache,~/.cache/vim,/var/tmp,/usr/tmp,/tmp

as vim handles ~, dotdirs, and / separators as expected, even under Windows.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-02-27  7:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-20 18:16 vim 64 conflict with windows slash and swapfile Taylor, Kit
2019-02-25 22:05 ` L A Walsh
2019-02-25 23:31   ` Taylor, Kit
2019-02-27 10:31     ` Brian Inglis
2019-02-26  8:57   ` Csaba Raduly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).