From: Schroen on
Hoi,

I have set several breakpoints in a file. Not all of the breakpoints are visually shown by red bullets, so I call dbstatus("-completenames"). The output:

Breakpoint for E:\DirA\DirC\FileD.m>FileD.m is on line 119.
Breakpoint for E:\DirA\DirB\..\DirC\FileD.m>FileD.m is on line 116.

Meaning, for FileD.m exist two paths: the first path is the direct path, the second one contains .., which are correct but superfluous.

Problem: One of the breakpoints is ignored by the debugger. Neither can I switch it of by mouse-clicking (since the red bullet is not shown), nor can I switch it of by dbclear('FileD').

However, I can still kill all breakpoints by dbclear all.

Question: Is there another easy solution? Is there a function, to reduce the filepath to its bare minimum (meaning without dots)? Fullfile does not seem to support this.

Greetings
/Schroen
From: us on
"Schroen " <t.schreiter(a)tudelft.nl> wrote in message <i24jdc$6m6$1(a)fred.mathworks.com>...
> Hoi,
>
> I have set several breakpoints in a file. Not all of the breakpoints are visually shown by red bullets, so I call dbstatus("-completenames"). The output:
>
> Breakpoint for E:\DirA\DirC\FileD.m>FileD.m is on line 119.
> Breakpoint for E:\DirA\DirB\..\DirC\FileD.m>FileD.m is on line 116.
>
> Meaning, for FileD.m exist two paths: the first path is the direct path, the second one contains .., which are correct but superfluous.
>
> Problem: One of the breakpoints is ignored by the debugger. Neither can I switch it of by mouse-clicking (since the red bullet is not shown), nor can I switch it of by dbclear('FileD').
>
> However, I can still kill all breakpoints by dbclear all.
>
> Question: Is there another easy solution? Is there a function, to reduce the filepath to its bare minimum (meaning without dots)? Fullfile does not seem to support this.
>
> Greetings
> /Schroen

one of the many solutions

mr=matlabroot;
frel=[mr,'/toolbox/matlab/../../toolbox/matlab/ops/../ops/unique.m'];
fabs=which(frel)
% fabs = mr\toolbox\matlab\ops\unique.m

us
From: Jan Simon on
Dear Schroen,

> Question: Is there another easy solution? Is there a function, to reduce the filepath to its bare minimum (meaning without dots)?

It os not easy to remove the \.. and \. from a path efficientlly. Splitting the path at the separators, deleting the "." and the removing the ".." together with their predessors is slow.
Under Windows the fast GetFullPath system call can solve this. In addition it adds the needed "\\?\" or "\\?\UNC" infront of the string if the file name exceeds MAX_PATH characters (this was e.g. 260 in WinXP).
GetFullPath converts partial paths to full qualified paths also very fast. Is somebody interested in a C-Mex to call GetFullPath on Windows?

Jan
From: us on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i25apg$muk$1(a)fred.mathworks.com>...
> Dear Schroen,
>
> > Question: Is there another easy solution? Is there a function, to reduce the filepath to its bare minimum (meaning without dots)?
>
> It os not easy to remove the \.. and \. from a path efficientlly. Splitting the path at the separators, deleting the "." and the removing the ".." together with their predessors is slow.
> Under Windows the fast GetFullPath system call can solve this. In addition it adds the needed "\\?\" or "\\?\UNC" infront of the string if the file name exceeds MAX_PATH characters (this was e.g. 260 in WinXP).
> GetFullPath converts partial paths to full qualified paths also very fast. Is somebody interested in a C-Mex to call GetFullPath on Windows?
>
> Jan

well...
consider that these already do the job

help which; % <- as shown in the example above
% and in recent ML versions
fnam=System.IO.FileInfo(fnam); % <- with a slew of output infos
% plus, there's still good old slow java's file class...

us
From: Schroen on
Dear us and Jan,

Thank you for your answers. However I am not sure if it solves the problem, though.

I could not find the function GetFullPath (neither in Matlab nor in the system). Jan, do you have a Matlab version you can provide?

The Javacall seems a bit heavy (and slow). I have to look deep enough into it if it can solve the problem.

I analyzed the problem more: The selection of the path (whether with dots or without) depends on the current working directory. So, when I am debugging in FileD's directory, the path without the dots is chosen. In contrast, when debugging in a different directory, the path with the dots is chosen.

/Schroen