Modifications

Sauter à la navigation Sauter à la recherche
394 octets ajoutés ,  20 mars 2022 à 00:04
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{ENG-CANSAT-PICO-NAV}}
 
{{ENG-CANSAT-PICO-NAV}}
   −
{{traduction}}
   
== MicroPython File System ==
 
== MicroPython File System ==
MicroPython board does fits an internal file system. This means that Python language on a MicroPython board can also manage files and directories!
+
MicroPython board does fits an internal file system. This means that Python language on a MicroPython board can also manage files and directories! Exactly like python does on a computer :-).
    
[[Fichier:MicroPython-FileSystem.png|256px]]
 
[[Fichier:MicroPython-FileSystem.png|256px]]
Ligne 50 : Ligne 49 :  
* the {{fname|strip('\r\n')}} remove the carriage return & line feed from the readed line. Otherwise it will also be printed to the REPL (which result into a double line feed).
 
* the {{fname|strip('\r\n')}} remove the carriage return & line feed from the readed line. Otherwise it will also be printed to the REPL (which result into a double line feed).
   −
== File-system, Writing and data lost ==
+
== File-systems, Writing and data lost ==
    
{{underline|'''The computer file-system:'''}}
 
{{underline|'''The computer file-system:'''}}
Ligne 78 : Ligne 77 :  
LittleFS is a flash-based device filesystem. It has been designed to be more resistant to filesystem corruption and power failures resilient. Unless other file-systems, the RAM used by LittleFS does not depend on the file-system size (it is said "RAM bounded" without RAM allocation overflow). See [https://github.com/littlefs-project/littlefs LittleFS Github] for more information.  
 
LittleFS is a flash-based device filesystem. It has been designed to be more resistant to filesystem corruption and power failures resilient. Unless other file-systems, the RAM used by LittleFS does not depend on the file-system size (it is said "RAM bounded" without RAM allocation overflow). See [https://github.com/littlefs-project/littlefs LittleFS Github] for more information.  
   −
So, even if LittleFS do have some minimal buffering, it is possible to force writing to the flah ( with {{fname|flush()}} ). So the user code can rely on better file-system stability and better control over forced writing operation.
+
So, even if LittleFS do have minimal buffering, it is possible to force writing to the flash ( with {{fname|flush()}} ) to ensure minimal data lost in case of issue. So the user code can rely on better file-system stability and better control over forced writing operation.
    
The following example just {{fname|flush()}} writes at every line written to the file.  
 
The following example just {{fname|flush()}} writes at every line written to the file.  
Ligne 97 : Ligne 96 :     
[[Fichier:LittleFS-flushed.png|640px]]
 
[[Fichier:LittleFS-flushed.png|640px]]
 +
 +
== Ressources ==
 +
* [https://docs.micropython.org/en/latest/library/os.html Basic "operating system" services] (''micropython.org'')<br />Usual OS functions + file-system mounting, formating, block devices, etc
 +
* [https://docs.micropython.org/en/latest/reference/filesystem.html Working with filesystems] (micropython.org)
    
{{ENG-CANSAT-PICO-TRAILER}}
 
{{ENG-CANSAT-PICO-TRAILER}}
29 917

modifications

Menu de navigation