fileparts

Renvoie le chemin, le nom de fichier et l'extension d'un chemin de fichier.

📝 Syntaxe

  • [p, f, e] = fileparts(fullpath)

  • p = fileparts(fullpath, 'path')

  • f = fileparts(fullpath, 'filename')

  • e = fileparts(fullpath, 'extension')

📥 Argument d'entrée

  • fullpath - a string: chemin de fichier ou de répertoire.

📤 Argument de sortie

  • p - a string: chemin du répertoire de fullpath.

  • f - a string: nom de fichier sans extension de fullpath.

  • e - a string: extension de fullpath.

📄 Description

[p, f, e] = fileparts(fullpath) sépare le chemin en trois parties : chemin, nom de fichier, extension (incluant le point).

💡 Exemple

[p, f, e] = fileparts([nelsonroot(), '/etc/finish.m'])
p = fileparts([nelsonroot(), '/etc/finish.m'], 'path')
f = fileparts([nelsonroot(), '/etc/finish.m'], 'filename')
e = fileparts([nelsonroot(), '/etc/finish.m'], 'extension')

🔗 Voir aussi

isdir, isfile, pathsep, filesep.

🕔 Historique

Version
📄 Description

1.0.0

initial version

Last updated

Was this helpful?