[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
filesep extension
From: |
John W. Eaton |
Subject: |
filesep extension |
Date: |
Tue, 11 Nov 2008 11:31:46 -0500 |
On 11-Nov-2008, Michael Goffioul wrote:
| I noticed a problem in fileparts tests: some tests uses forward slash,
| while fileparts uses filesep, which is the backward slash under Windows.
| This makes most tests to fail.
|
| To solve that, I thought about extending filesep behavior and make it
| return all file separators when 'all' is given as argument. See the attached
| changeset (OK to apply?). However, now I'd like to modify fileparts.m,
| but I'm not sure about the most efficient way to implement find_last_of
| functionality in ocave. Any idea?
See also this thread:
https://www-old.cae.wisc.edu/pipermail/octave-maintainers/2008-October/009169.html
I think your patch is also OK.
I'm not sure what to suggest for the best scripting language
equivalent for find_last_of. A regular expression? That doesn't seem
like a great solution and would be a bit messy in the current case
because \ is special in a regular expression. For example, you need
something like
regexp ('/foo/bar\baz', '[\\/][^\\/]*$')
Do we need a new function, or can someone think of a good way to do
this with functions we currently have?
jwe
- filesep extension, Michael Goffioul, 2008/11/11
- filesep extension,
John W. Eaton <=
- Re: filesep extension, Jaroslav Hajek, 2008/11/11
- Re: filesep extension, Michael Goffioul, 2008/11/12
- Re: filesep extension, Jaroslav Hajek, 2008/11/12
- Re: filesep extension, Michael Goffioul, 2008/11/12
- Re: filesep extension, Jaroslav Hajek, 2008/11/12
- Re: filesep extension, Søren Hauberg, 2008/11/12