How to consistently scan for a text file (or any file)?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tamfor Dulin
le 10 Fév 2015
Modifié(e) : Tamfor Dulin
le 11 Fév 2015
So I wanted my app to scan a text file consistently... So that it will update according to what the file has soon as the file is in that specific directory. How is that possible?? Because I have no clue what is the function for that.
0 commentaires
Réponse acceptée
per isakson
le 10 Fév 2015
Modifié(e) : per isakson
le 10 Fév 2015
Create a FileSystemWatcher object fileObj and watch the Changed event for files
with a .txt extension in the folder C:\work\temp.
fileObj = System.IO.FileSystemWatcher('c:\work\temp');
fileObj.Filter = '*.txt';
fileObj.EnableRaisingEvents = true;
addlistener(fileObj,'Changed',@eventhandlerChanged);
"scan a text file consistently"   what exactly do you want to do. Read the file and search for specific content?
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!