genpath2

genpath2 calls genpath and removes folders matching a specified pattern
92 download
Aggiornato 7 feb 2021

Description
MATLAB's genpath(folderName) creates a character vector containg the path to folderName and any of its subfolders. genpath excludes folders starting with @, +, private, and resource, but it does not allow users to specify other patterns to exclude from its output.

This can cause problems when users addpath using the output of genpath. For one, it becomes more difficult to parse the output of path because many potentially unused folders are now on the file path. And similarly, it can lead to frequent folder handle notifications from MATLAB as it searches through unusued folders for files--especially when using busy network drives.

This is where genpath2 comes in. Inspired by Jesse Hopkins's genpath_exclude, genpath2 is a wrapper for genpath (instead of a standalone function) that executes genpath and then removes folders from its output matching a specified pattern.

Usage
genpath2(folderName) returns a vector identical to genpath(folderName)
genpath2(folderName, '.git') returns a vector without folders starting with .git
genpath2(folderName, {'.git', '.svn'}) returns a vector without folders starting with .git or .svn

Contributing
Original Author: Santiago I. Sordo-Palacios
If you find a bug or would like to add a feature, please open and issue and submit a pull request via the GitHub Project. I do not monitor comments on the MATLAB File Exchange.

Cita come

Santiago Sordo-Palacios (2024). genpath2 (https://github.com/ssordopalacios/matlab-genpath2), GitHub. Recuperato .

Compatibilità della release di MATLAB
Creato con R2019a
Compatibile con R2016b fino a R2019a
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Search Path in Help Center e MATLAB Answers
Tag Aggiungi tag
Riconoscimenti

Ispirato da: genpath_exclude

Community Treasure Hunt

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

Start Hunting!

Le versioni che utilizzano il ramo predefinito di GitHub non possono essere scaricate

Versione Pubblicato Note della release
1.0.0

Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.
Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.