Path with shortcut/link
이전 댓글 표시
Does Matlab support shortcuts or symbolic links in paths. Example:
/lib_v1.1
/lib_v1.2
/current -> /lib_v1.2
The "current" is a shortcut to the latest version of the lib, but is displayed as current.lnk by the dir command
>> dir
. .. current.lnk lib_v1.1 lib_v1.2
It have no effect when adding the path
addpath(genpath('current'))
and will result in an error by cd
>> cd('current')
??? Error using ==> cd
Cannot CD to current (Name is nonexistent or not a directory).
>> cd('current.lnk')
??? Error using ==> cd
Cannot CD to current.lnk (Name is nonexistent or not a directory).
What are my options?
댓글 수: 1
Jan
2012년 7월 5일
Do you need this on a Windows, Linux or MacOS? And if it concerns Windows, could you obtain admin privilegs to create hard-links instead of the not working soft-links?
채택된 답변
추가 답변 (1개)
Walter Roberson
2012년 7월 4일
1 개 추천
MS Windows does not have true links. The .lnk file you are seeing is processed by Windows Explorer rather than by MS Windows. In order for programs to take .lnk files in to account, the programs have to detect them and make a call to Windows Explorer to do the resolution on behalf of the program.
The situation is quite different in Linux and OS-X, both of which handle symbolic links automatically at the operating system level (and require that programs take extra actions if they want to distinguish symbolic links from regular files.)
카테고리
도움말 센터 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!