Delete unnecessary subdirectory rmpath and addpath ( automatically Set Path)

4 visualizaciones (últimos 30 días)
addpath(genpath('X:\Library\')); Read all subdirectory % In the library are more subdirectory with \.svn % I want to delete everything subdirectory with \.svn % Examples X:\Library\1\1\.svn; X:\Library\2\1\.svn; X:\Library\1\.svn ; X:\Library\1\1\1\.svn %rmpath(genpath('X:\Library\1\1\.svn')); This command is delted everything subdirectory.
How do I automatically delete all subdirectories in .svn directories.
Exmple: rmpath(genpath('\.svn')); does not work - I wanted to delete evrything subdirectories

Respuestas (1)

Jan
Jan el 22 de En. de 2018
Why do you append all folders generated by genpath only to remove some folders afterwards? Simply clean up the list of folders at first:
list = genpath('X:\Library\');
folders = strsplit(list, pathsep);
folders(contains(folders, '.svn')) = [];
newlist = sprintf('%s:', folders{:});
addpath(newlist);

Categorías

Más información sobre Search Path en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by