Question about non-existing file
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sophie Sturkenboom
am 15 Jul. 2022
Kommentiert: Sophie Sturkenboom
am 20 Jul. 2022
Hi,
I'm trying to run a script to load the data, but i'm getting an error. The error basically says that it reads another file in the folder, but that's weird because the file doesn't exist.
If I use the function dir() it says there is another file named '_Pelvis_Walk.csv'. Does anyone know why this is, and most importantly: how can I fix this?
0 Kommentare
Akzeptierte Antwort
Stephen23
am 15 Jul. 2022
Bearbeitet: Stephen23
am 15 Jul. 2022
" If I use the function dir() it says there is another file named '_Pelvis_Walk.csv'."
No, your screenshot clearly shows that the file is named '._Pelvis_Walk.csv'. Note the leading dot! The leading dot and underscore tell us that this file is a hidden file on Mac OSX. Most OSs include special hidden files, but just because they are not displayed using the normal Explorer app (or whatever Mac call it) does not mean that they do not exist.
"Does anyone know why this is, and most importantly: how can I fix this?"
Mac OSX uses these files to store meta-data about your file. Note that there is a lot of misinformation on the internet about these files, here is a reputable explanation:
I will copy one line from that explanation here: "The name starts with "." because many operating systems (most Unix and Linux variants) normally treat such names as invisible, even if they don't support an explicit "invisible" flag in metadata."
So DIR is correct to return it, because it is a file that exists on that drive. From that point of view, there is nothing to be "fixed". Howver you can easily remove those elements from the structure:
S = dir(..);
X = strncmp({S.name},'.',1);
S(X) = []
Also: rather than creating filepaths using concatenation you should use FULLFILE.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu File Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!