|
|
Wildcard bug in matlab (linux version)
In matlab 2010a I am running into a problem with the use of wildcards ( ?) in the dir command on linux operating systems (but not on windows). I run the following commands and get the listed output:
>> dir('*.m')
a11a.m a12a.m a21a.m b11a.m
a11b.m a12b.m a22a.m b21a.m
>> dir('a*.m')
a11a.m a11b.m a12a.m a12b.m a21a.m a22a.m
>> dir('a?1*.m')
a?1*.m not found.
I expect: a11a.m a11b.m a21a.m
On windows it works as expected.
Can anyone confirm is this is a bug or user error?
|
|
0
|
|
|
|
Reply
|
ri
|
5/7/2010 10:58:04 PM |
|
In article <hs25ts$hcb$1@fred.mathworks.com>,
"ri " <rirad@hotmail.com.removethis> wrote:
> In matlab 2010a I am running into a problem with the use of wildcards ( ?)
> in the dir command on linux operating systems (but not on windows). I run the
> following commands and get the listed output:
>
> >> dir('*.m')
> a11a.m a12a.m a21a.m b11a.m
> a11b.m a12b.m a22a.m b21a.m
>
> >> dir('a*.m')
> a11a.m a11b.m a12a.m a12b.m a21a.m a22a.m
>
> >> dir('a?1*.m')
> a?1*.m not found.
>
> I expect: a11a.m a11b.m a21a.m
>
> On windows it works as expected.
>
> Can anyone confirm is this is a bug or user error?
There is nothing in the documentation for dir to indicate that you can
use ? as a wildcard character. The bug is that it works on Windows. :-)
--
Doug Schwarz
dmschwarz&ieee,org
Make obvious changes to get real email address.
|
|
0
|
|
|
|
Reply
|
Doug
|
5/8/2010 12:57:45 PM
|
|
"ri " <rirad@hotmail.com.removethis> wrote in message <hs25ts$hcb$1@fred.mathworks.com>...
> In matlab 2010a I am running into a problem with the use of wildcards ( ?) in the dir command on linux operating systems (but not on windows). I run the following commands and get the listed output:
>
> >> dir('*.m')
> a11a.m a12a.m a21a.m b11a.m
> a11b.m a12b.m a22a.m b21a.m
>
> >> dir('a*.m')
> a11a.m a11b.m a12a.m a12b.m a21a.m a22a.m
>
> >> dir('a?1*.m')
> a?1*.m not found.
>
> I expect: a11a.m a11b.m a21a.m
>
> On windows it works as expected.
>
> Can anyone confirm is this is a bug or user error?
Hi, I agree with the post by Doug. Are you sure that:
dir('a?1*.m')
works on a Windows machine? That does not work for me in R2010a in Windows.
Wayne
|
|
0
|
|
|
|
Reply
|
Wayne
|
5/8/2010 1:45:20 PM
|
|
This is what I get on 2009b (on windows XP)
>> dir('*.m')
a11a.m a12a.m a21a.m b21a.m
a11b.m a12b.m b11a.m
>> dir('a*.m')
a11a.m a11b.m a12a.m a12b.m a21a.m
>> dir('a?1*.m')
a11a.m a11b.m a21a.m
If thus indeed is an unsupported feature on the windows version, the consequence is that m scripts do not run similarly on different platforms (the ? wildcard also did not work in the linux 2009b version). I can not test the 2010a version on windows, but according to your test they must have removed this possibility in the latest windows version.
Thanks for the replies.
> Hi, I agree with the post by Doug. Are you sure that:
>
> dir('a?1*.m')
>
> works on a Windows machine? That does not work for me in R2010a in Windows.
>
> Wayne
|
|
0
|
|
|
|
Reply
|
ri
|
5/10/2010 8:08:06 PM
|
|
ri wrote:
>>> dir('a?1*.m')
>
> a11a.m a11b.m a21a.m
> If thus indeed is an unsupported feature on the windows version, the
> consequence is that m scripts do not run similarly on different
> platforms (the ? wildcard also did not work in the linux 2009b version).
There are a fair number of aspects of Matlab that work differently on
different operating systems
- behaviour of cd when a name followed by a colon is specified
On Windows, changes drives into the last active directory on that drive, if
the name is a drive name; fails if the name is the name of any other kind of
device; changes drives and directories to somewhere unknown if the name has
been mapped to a drive and directory; could do something else if the name
refers to an object that has an active fork (e.g., it might be a virtual
device, perhaps a reference into a zip file or across a network or just about
anything else);
On other systems, changes into a relative sub-directory of the current
directory, if a relative subdirectory exists whose name is exactly as given
including the colon; gives random odd results if an object exists in the
current directory whose name is exactly as given including the colon, if the
object refers to a socket or character device (e.g., tape drive); could end up
nearly anywhere accessible if the object is a symbolic link (symbolic links on
Windows cannot include ':' in their name.)
- / is required as the path separator on systems other than Windows; on
Windows, either / or \ may be used
- dos() command is supported only on Windows
- system() command strings will be interpreted differently on different
systems, including possibly for different systems with the same operating
system: on Linux systems, different system shells can be configured by the
system administrator
- system_dependent() call exists and is used to (e.g.) set calculation
precision on Windows
- ActiveX is meaningful only on Windows
- xlswrite() talks via DCOM interface to Excel executable to produce a binary
Excel file, with support for cell files containing values of different kinds
-- Windows only, all other systems support only numeric or character arrays
and produce a plain text file
- movie and sound file support is OS dependent, with some media players only
supported on Windows, and with different file kinds supported for Windows vs
Linux vs MacOS
- the BLAS libraries are optimized by CPU (and possibly by operating system),
and thus heavy mathematics can produce different results on different systems
- not all toolboxes are supported on all platforms
- the compilers supported by the Compiler or Real Time or Embedded toolboxes
differ with platform
- the OpenGL renderer can act differently on different systems, including
possibly according to graphics card and operating system
And probably more that I have forgotten at the moment.
|
|
0
|
|
|
|
Reply
|
Walter
|
5/10/2010 11:12:00 PM
|
|
|
4 Replies
278 Views
(page loaded in 0.082 seconds)
|
|
|
|
|
|
|
|
|