[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fileparts.m in octave (mingw and msvc)
From: |
Tatsuro MATSUOKA |
Subject: |
Re: fileparts.m in octave (mingw and msvc) |
Date: |
Sun, 18 Jan 2009 16:17:28 +0900 (JST) |
Hello
I have considered a patch.
Sorry I cannot use Mercurial correctly.
So I placed 'diff -r' instead in the following:
# start
30c30,34
< ds = rindex (filename, filesep);
---
> if !( findstr (octave_config_info('canonical_host_type'), 'msvc') ||
> findstr
(octave_config_info('canonical_host_type'), 'mingw') )
> ds = rindex (filename, filesep);
> else
> ds = max (rindex (filename, "\\"),rindex (filename, "/"));
> endif
68,69c72,73
< %! [d, n, e] = fileparts ("/file.ext");
< %! assert (strcmp (d, "/") && strcmp (n, "file") && strcmp (e, ".ext"));
---
> %! [d, n, e] = fileparts ([filesep "file.ext"]);
> %! assert (strcmp (d, filesep) && strcmp (n, "file") && strcmp (e, ".ext"));
72c76
< %! [d, n, e] = fileparts ("dir/file.ext");
---
> %! [d, n, e] = fileparts (["dir" filesep "file.ext"]);
76c80
< %! [d, n, e] = fileparts ("./file.ext");
---
> %! [d, n, e] = fileparts (["." filesep "file.ext");
80c84
< %! [d, n, e] = fileparts ("d1/d2/file.ext");
---
> %! [d, n, e] = fileparts (["d1" filesep "d2" filesep "file.ext"]);
84c88
< %! [d, n, e] = fileparts ("/d1/d2/file.ext");
---
> %! [d, n, e] = fileparts ([filesep "d1" filesep "d2" filesep "file.ext"]);
88c92
< %! [d, n, e] = fileparts ("/.ext");
---
> %! [d, n, e] = fileparts ([filesep ".ext"]);
# end
Regards
Tatsuro
--- Tatsuro MATSUOKA <address@hidden> wrote:
> Hello
>
> In octave for windows (except cygwin), a path name sometime contains both
> backslashes (\) and
> slashes
> (/) like,
>
> c:\usr\Tatsu\mingwhome\octaves\octave-3.0.4RC1\scripts/miscellaneous\fileparts.m
>
>
> Should fileparts.m in octave for windows be adaptable for both separators?
>
> Anyway I will consider the modification if my family will remain time for me
> to do :-).
>
> Regards
>
> Tatsuro
>
> --------------------------------------
> Power up the Internet with Yahoo! Toolbar.
> http://pr.mail.yahoo.co.jp/toolbar/
>
--------------------------------------
Power up the Internet with Yahoo! Toolbar.
http://pr.mail.yahoo.co.jp/toolbar/
- fileparts.m in octave (mingw and msvc), Tatsuro MATSUOKA, 2009/01/18
- Re: fileparts.m in octave (mingw and msvc),
Tatsuro MATSUOKA <=
- Re: fileparts.m in octave (mingw and msvc), Michael Goffioul, 2009/01/18
- Re: fileparts.m in octave (mingw and msvc), Tatsuro MATSUOKA, 2009/01/18
- Re: fileparts.m in octave (mingw and msvc), Michael Goffioul, 2009/01/19
- Re: fileparts.m in octave (mingw and msvc), Jaroslav Hajek, 2009/01/19
- Re: fileparts.m in octave (mingw and msvc), Tatsuro MATSUOKA, 2009/01/19
- Re: fileparts.m in octave (mingw and msvc), Jaroslav Hajek, 2009/01/21
- Re: fileparts.m in octave (mingw and msvc), John W. Eaton, 2009/01/27