annotate scripts/miscellaneous/fullfile.m @ 20164:df437a52bcaf stable

doc: Update more docstrings to have one sentence summary as first line. Reviewed miscellaneous, sparse, strings in scripts directory. * scripts/miscellaneous/bzip2.m, scripts/miscellaneous/citation.m, scripts/miscellaneous/compare_versions.m, scripts/miscellaneous/computer.m, scripts/miscellaneous/debug.m, scripts/miscellaneous/dir.m, scripts/miscellaneous/edit.m, scripts/miscellaneous/error_ids.m, scripts/miscellaneous/fileattrib.m, scripts/miscellaneous/fullfile.m, scripts/miscellaneous/genvarname.m, scripts/miscellaneous/gzip.m, scripts/miscellaneous/mkoctfile.m, scripts/miscellaneous/news.m, scripts/miscellaneous/open.m, scripts/miscellaneous/parseparams.m, scripts/miscellaneous/recycle.m, scripts/miscellaneous/run.m, scripts/miscellaneous/swapbytes.m, scripts/miscellaneous/tar.m, scripts/miscellaneous/tmpnam.m, scripts/miscellaneous/unpack.m, scripts/miscellaneous/what.m, scripts/sparse/bicg.m, scripts/sparse/bicgstab.m, scripts/sparse/cgs.m, scripts/sparse/colperm.m, scripts/sparse/eigs.m, scripts/sparse/etreeplot.m, scripts/sparse/gmres.m, scripts/sparse/gplot.m, scripts/sparse/ichol.m, scripts/sparse/ilu.m, scripts/sparse/pcg.m, scripts/sparse/pcr.m, scripts/sparse/qmr.m, scripts/sparse/spaugment.m, scripts/sparse/spconvert.m, scripts/sparse/spdiags.m, scripts/sparse/spfun.m, scripts/sparse/spones.m, scripts/sparse/sprandsym.m, scripts/sparse/spstats.m, scripts/sparse/spy.m, scripts/sparse/svds.m, scripts/sparse/treelayout.m, scripts/sparse/treeplot.m, scripts/strings/base2dec.m, scripts/strings/bin2dec.m, scripts/strings/blanks.m, scripts/strings/cstrcat.m, scripts/strings/deblank.m, scripts/strings/dec2base.m, scripts/strings/dec2bin.m, scripts/strings/dec2hex.m, scripts/strings/findstr.m, scripts/strings/hex2dec.m, scripts/strings/index.m, scripts/strings/isletter.m, scripts/strings/isstrprop.m, scripts/strings/mat2str.m, scripts/strings/ostrsplit.m, scripts/strings/regexptranslate.m, scripts/strings/rindex.m, scripts/strings/str2num.m, scripts/strings/strcat.m, scripts/strings/strchr.m, scripts/strings/strjoin.m, scripts/strings/strjust.m, scripts/strings/strmatch.m, scripts/strings/strsplit.m, scripts/strings/strtok.m, scripts/strings/strtrim.m, scripts/strings/strtrunc.m, scripts/strings/substr.m, scripts/strings/untabify.m, scripts/time/datenum.m: Update more docstrings to have one sentence summary as first line.
author Rik <rik@octave.org>
date Mon, 04 May 2015 14:22:02 -0700
parents 9fc020886ae9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 19597
diff changeset
1 ## Copyright (C) 2014-2015 Carnë Draug
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
2 ##
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
4 ##
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
8 ## your option) any later version.
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
9 ##
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
13 ## General Public License for more details.
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
14 ##
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
17 ## <http://www.gnu.org/licenses/>.
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
18
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
19214
8cc4a9bb253b fullfile.m: Match documentation name to function variable name.
Rik <rik@octave.org>
parents: 19186
diff changeset
20 ## @deftypefn {Function File} {@var{filename} =} fullfile (@var{dir1}, @var{dir2}, @dots{}, @var{file})
8cc4a9bb253b fullfile.m: Match documentation name to function variable name.
Rik <rik@octave.org>
parents: 19186
diff changeset
21 ## @deftypefnx {Function File} {@var{filenames} =} fullfile (@dots{}, @var{files})
19185
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
22 ## Build complete filename from separate parts.
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
23 ##
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
24 ## Joins any number of path components intelligently. The return value is
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
25 ## the concatenation of each component with exactly one file separator
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
26 ## between each non empty part and at most one leading and/or trailing file
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
27 ## separator.
19185
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
28 ##
19186
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
29 ## If the last component part is a cell array, returns a cell array of
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
30 ## filepaths, one for each element in the last component, e.g.:
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
31 ##
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
32 ## @example
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
33 ## @group
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
34 ## fullfile ("/home/username", "data", @{"f1.csv", "f2.csv", "f3.csv"@})
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
35 ## @result{} /home/username/data/f1.csv
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
36 ## /home/username/data/f2.csv
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
37 ## /home/username/data/f3.csv
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
38 ## @end group
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
39 ## @end example
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
40 ##
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
41 ## On Windows systems, while forward slash file separators do work, they are
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
42 ## replaced by backslashes; in addition drive letters are stripped of leading
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
43 ## file separators to obtain a valid file path.
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
44 ##
19214
8cc4a9bb253b fullfile.m: Match documentation name to function variable name.
Rik <rik@octave.org>
parents: 19186
diff changeset
45 ## @seealso{fileparts, filesep}
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
46 ## @end deftypefn
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
47
19185
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
48 ## Author: Carnë Draug <carandraug@octave.org>
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
49
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
50 function filename = fullfile (varargin)
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
51
19186
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
52 if (nargin && iscell (varargin{end}))
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
53 filename = cellfun (@(x) fullfile (varargin{1:end-1}, x), varargin{end},
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
54 "UniformOutput", false);
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
55 else
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
56 non_empty = cellfun ("isempty", varargin);
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
57 if (ispc && ! isempty (varargin))
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
58 varargin = strrep (varargin, "/", filesep);
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
59 varargin(1) = regexprep (varargin{1}, '[\\/]*([a-zA-Z]:[\\/]*)', "$1");
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
60 endif
19186
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
61 filename = strjoin (varargin(! non_empty), filesep);
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
62 filename(strfind (filename, [filesep filesep])) = "";
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
63 endif
4265
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
64
48897c78c52b [project @ 2003-01-03 06:04:29 by jwe]
jwe
parents:
diff changeset
65 endfunction
7288
1885f4c7e4b3 [project @ 2007-12-11 17:19:44 by jwe]
jwe
parents: 7017
diff changeset
66
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
67
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
68 %!shared fs, fsx, xfs, fsxfs, xfsy, xfsyfs
7514
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
69 %! fs = filesep ();
16994
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 14363
diff changeset
70 %! fsx = [fs "x"];
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 14363
diff changeset
71 %! xfs = ["x" fs];
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 14363
diff changeset
72 %! fsxfs = [fs "x" fs];
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 14363
diff changeset
73 %! xfsy = ["x" fs "y"];
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
74 %! xfsyfs = ["x" fs "y" fs];
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
75
7288
1885f4c7e4b3 [project @ 2007-12-11 17:19:44 by jwe]
jwe
parents: 7017
diff changeset
76 %!assert (fullfile (""), "")
7514
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
77 %!assert (fullfile (fs), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
78 %!assert (fullfile ("", fs), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
79 %!assert (fullfile (fs, ""), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
80 %!assert (fullfile ("", fs), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
81 %!assert (fullfile ("x"), "x")
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
82 %!assert (fullfile ("", "x"), "x")
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
83 %!assert (fullfile ("x", ""), "x")
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
84 %!assert (fullfile ("", "x", ""), "x")
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
85 %!assert (fullfile ("x", "y"), xfsy)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
86 %!assert (fullfile ("x", "", "y"), xfsy)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
87 %!assert (fullfile ("x", "", "y", ""), xfsy)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
88 %!assert (fullfile ("", "x", "", "y", ""), xfsy)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
89 %!assert (fullfile (fs), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
90 %!assert (fullfile (fs, fs), fs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
91 %!assert (fullfile (fs, "x"), fsx)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
92 %!assert (fullfile (fs, xfs), fsxfs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
93 %!assert (fullfile (fsx, fs), fsxfs)
4f6a73fd8df9 fullfile: improve handling of args ending with filesep
John W. Eaton <jwe@octave.org>
parents: 7288
diff changeset
94 %!assert (fullfile (fs, "x", fs), fsxfs)
14363
f3d52523cde1 Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
95
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
96 %!assert (fullfile ("x/", "/", "/", "y", "/", "/"), xfsyfs)
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
97 %!assert (fullfile ("/", "x/", "/", "/", "y", "/", "/"), [fs xfsyfs])
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
98 %!assert (fullfile ("/x/", "/", "/", "y", "/", "/"), [fs xfsyfs])
19185
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
99
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
100 ## different on purpose so that "fullfile (c{:})" works for empty c
8ca827e18349 fullfile: complete rewrite of the function.
Carnë Draug <carandraug@octave.org>
parents: 17744
diff changeset
101 %!assert (fullfile (), "")
19186
1111d2d5ff95 fullfile.m: add support for multiple paths with cell array for last component.
Carnë Draug <carandraug@octave.org>
parents: 19185
diff changeset
102
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
103 %!assert (fullfile ("x", "y", {"c", "d"}), {[xfsyfs "c"], [xfsyfs "d"]})
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
104
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
105 ## Windows specific - drive letters and file sep type
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
106 %!test
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
107 %! if (ispc)
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
108 %! assert (fullfile ('\/\/\//A:/\/\', "x/", "/", "/", "y", "/", "/"), ...
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
109 %! ['A:\' xfsyfs]);
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
110 %! endif
19214
8cc4a9bb253b fullfile.m: Match documentation name to function variable name.
Rik <rik@octave.org>
parents: 19186
diff changeset
111
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
112 ## Windows specific - drive letters and file sep type, cell array
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
113 %!test
19597
db92e7e28e1f strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents: 19564
diff changeset
114 %! if (ispc)
19564
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
115 %! tmp = fullfile ({"\\\/B:\//", "A://c", "\\\C:/g/h/i/j\/"});
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
116 %! assert (tmp{1}, 'B:\');
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
117 %! assert (tmp{2}, 'A:\c');
c304687571c8 fullfile.m: properly process file separators and drive letters on Windows systems (bug #43926)
Philip Nienhuis <prnienhuis@users.sf.net>
parents: 19214
diff changeset
118 %! assert (tmp{3}, 'C:\g\h\i\j\');
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
119 %! endif