Case-sensitive file move
Mostra commenti meno recenti
Is it possible to rename a file if the only difference between the old and new names is the case? A command such as
movefile('test.txt','Test.txt')
returns the error
Cannot copy or move a file or directory onto itself.
I'm making a GUI with the option to rename files, and while being able to do case-sensitive moves like that is not essential, it would certainly be nice.
Risposta accettata
Più risposte (1)
Vaibhav Awale
il 11 Gen 2016
0 voti
Hi,
The command;
>> movefile('test.txt','Test.txt')
makes a copy of the original file and then removes the original file. Now both files are located in the same folder and Windows systems are not case sensitive with respect to file names. Hence MATLAB throws an error saying "Cannot copy or move a file or directory onto itself."
Regards,
Vaibhav Awale
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!