Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
Exclude System or Hidden Folders from Mac Dir List
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1362813/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1362818/image.png)
25 commentaires
- 'System Volume Information' is a directory included when I use Dir on a Mac. I assume this is both a Sytem file and perhaps hidden file. I just need to make sure that I can remove it from my Dir list (eg. I do not want to copy this dir by mistake, or include this dir for a user to select.. and subsequently encounter uncontrollable error conditions.
- AVF_INFO. This is a hidden directory created by Sony when they format Sd cards in their cameras. It contains a database of the images and video files stored on the SD card and allows the Sony cameras display thumnnails and other key features on a modern digital camera. Again, this is invisible, by default in most scenarios.... but it is included in the contents of a Dir command. What is worse..... the attributes function returns a value of NaN for this directory.... so other than hard coding this directory name, I cannot exclude it from a dir list... so my app will fail at some stage when it tries to take inappropriate actions on these directories.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1363718/image.png)
- I have started to look at the ls command... but not optimistic. Mac documentation for this command is extremely sparse and refers to general linux to get more info... which so far has not revealed a magic option... but have not given up on this.
- In the code window above... you can see that I have already removed all the dot and dot dot dirs, everything beginning with a dot. Sony have obviously found a way to flag a folder as hidden (AVF_INFO). No doubt Canon and Nikon and Fuji will all use similar techniques to keep their SD card housekeeping directories away from casual misuse. I know in Sony's case, if the AVF_INFO is missing the camera will give you a message... pls wait ... while it rebuilds it. My fear is that my code may need to be hardcoded for every brand of camera.
- There is a Mac keyboard combo of Cmd Shift + which reveals / hides System / Hidden files. I would love to be able to replicate this in code.
- I intend to investigate how Apple Swift / Xcode handles hidden files. The danger is that if I go that far it might be easier for me to write an Apple native app.
- The problem I have is that I have the app working for Windows but running aground trying to resolve this issue on the Mac.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1365754/image.png)
Réponses (5)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1366084/image.png)
4 commentaires
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1366644/image.jpeg)
- Explore, using native Apple apps, if I can separate visible and hidden dirs using a script or app
- Recce the possibility of aborting MatLab and reverting to Swift/Xcode and build my apps on Mac / Ipad /Iphone.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1377274/image.png)
8 commentaires
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1377769/image.png)
Voir également
Catégories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)