Borrar filtros
Borrar filtros

Why can't I move a file to destination './Raw_+1:00' in MATLAB R2013b on Windows?

10 visualizaciones (últimos 30 días)
I am using "movefile" to move a MAT-file from the MATLAB Curent Folder to a sub-folder named "Raw_+1:00". Here is my code:
>> movefile('test.mat', './Raw_+1:00')
Error using movefile
Cannot write to destination: C:\Documents\MATLAB\Raw_+1:00. Use the 'f' option to override.
I then try with the 'f' option as suggested by the error message and get:
>> movefile('test.mat', './Raw_+1:00', 'f')
Error using movefile
Unknown error occurred.
Am I doing something wrong?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 25 de Mzo. de 2014
Colon (:) is an illegal character and cannot be used in the name of a file or a directory on Windows. The error message was changed in MATLAB R2014a to better reflect the cause of the issue:
Error using movefile
The filename, directory name, or volume label syntax is incorrect.
The full set of invalid characters can vary by file system. For example, on Windows-based desktop platforms, invalid path characters might include ASCII/Unicode characters 1 through 31, as well as quote ("), less than (<), greater than (>), pipe (|), backspace (\b), null (\0) and tab (\t).
  1 comentario
Steven Lord
Steven Lord el 29 de Mayo de 2020
Here's what Microsoft has to say on the matter of file names, in part.
"Use any character in the current code page for a name, including Unicode characters and characters in the extended character set (128–255), except for the following:
  • The following reserved characters:
  • < (less than)
  • > (greater than)
  • : (colon)
  • " (double quote)
  • / (forward slash)
  • \ (backslash)
  • | (vertical bar or pipe)
  • ? (question mark)
  • * (asterisk)
"
The file name in the original question contains the colon character which appears on the list of reserved characters.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Productos


Versión

R2013b

Community Treasure Hunt

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

Start Hunting!

Translated by