octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #47950] glob and dir functions fail with escap


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #47950] glob and dir functions fail with escaped wildcard characters in Windows
Date: Sun, 22 May 2016 18:27:43 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0

Follow-up Comment #16, bug #47950 (project octave):

Here's a more basic question, does Windows let you create file names that
contain an asterisk or a question mark? Let's put aside left and right square
brackets for now.

If Windows lets you create a file literally named 'all*.txt', how would you
escape the asterisk to differentiate from a wildcard pattern? If Windows does
not allow those characters in filenames at all, then there is no issue with
escaping them.

According to a couple of pages, Windows only calls '*' and '?' wildcard
characters, it does not include character sets in square brackets as is
normally expected on Unix-like systems.

https://technet.microsoft.com/en-us/library/bb490639.aspx
https://en.wikipedia.org/wiki/Wildcard_character

So it sounds like this may be an OS-specific expectation that we could support
for a better experience. Maybe we need to make the set of wildcard characters
supported by the 'dir' function system-dependent, maybe by adding an option to
glob to not interpreter left and right square brackets as a character class
(basically always escape them on Windows if and only if called from the dir
function).

I am not that motivated to work on such a change, but if anyone agrees that
this would be best for native Windows users and wants to work on such a change
I think it would be acceptable.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?47950>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]