Maximum Path Length Exceeded?

59 views (last 30 days)
Kevin
Kevin on 31 Jul 2014
Commented: Walter Roberson on 13 Oct 2015
I'm running a compiled script that throws an error at
mkdir(x)
where x is the name of some path. The error is "Maximum path length exceeded".
I try running the exact same line in the command window, and it works just fine.
Any ideas as to what's going on?
Thanks.
  3 Comments
K E
K E on 13 Oct 2015
Can someone point to where "Long path tool" can be found? I don't see it in the file exchange.
Walter Roberson
Walter Roberson on 13 Oct 2015
The references to "long path tool" were spam :(

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 31 Jul 2014
Edited: Image Analyst on 31 Jul 2014
There is a limit to how long directory names can be, like 256 characters or something. What operating system are you using? What is length(x)? If you're making the folder a subfolder of the "current folder" it may be too long because a compiled app really runs out of some secret hidden folder that is really long. Put this in your script just before mkdir and see what it spits out to the console window:
pwd
fprintf('Length of %s = %d', x, length(x));
  1 Comment
Kevin
Kevin on 31 Jul 2014
This is just what I needed. In x I had somehow included the variable 'path', which put my entire search path in the directory name. Thanks!

Sign in to comment.

More Answers (0)

Categories

Find more on Search Path in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!