octave-maintainers
[Top][All Lists]
Advanced

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

Re: fileparts.m in octave (mingw and msvc)


From: Michael Goffioul
Subject: Re: fileparts.m in octave (mingw and msvc)
Date: Sun, 18 Jan 2009 10:15:05 +0000

I started to work on that problem 2 months ago and committed the
first half on the development branch,
see http://hg.savannah.gnu.org/hgweb/octave/rev/135c0e7d7802

I thought I also did the other half (on fileparts.m), but apparently I
didn't. Given the date of the first commit, it's probably because I
started my new job the day after...

If anyone wants to do, please do so. What's needed in fileparts.m
is using some sort of "find_first_of" implementation instead of
"rindex", and to retrieve all file separators using "filesep('all')"

Michael.


On Sun, Jan 18, 2009 at 7:17 AM, Tatsuro MATSUOKA <address@hidden> wrote:
> 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/
>


reply via email to

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