{"id":911,"date":"2023-10-23T08:05:08","date_gmt":"2023-10-23T12:05:08","guid":{"rendered":"https:\/\/ve2cuy.com\/?page_id=911"},"modified":"2024-09-18T10:06:10","modified_gmt":"2024-09-18T14:06:10","slug":"420-1c5-tp01-batch-2023","status":"publish","type":"page","link":"https:\/\/ve2cuy.com\/index.php\/420-1c5-tp01-batch-2023\/","title":{"rendered":"420-1C5 : TP01 Batch 2023"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-text-align-center\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">\u00c9nonc\u00e9 du TP01<\/mark> &#8211; <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">Version pr\u00e9liminaire<\/mark><br><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"579\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-07.33.52-1024x579.png\" alt=\"\" class=\"wp-image-912\" style=\"aspect-ratio:1.768566493955095;width:435px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-07.33.52-1024x579.png 1024w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-07.33.52-300x170.png 300w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-07.33.52-768x434.png 768w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-07.33.52.png 1248w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p><br><strong>Pond\u00e9ration<\/strong>: <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">10 %<\/mark><\/strong><br><strong>Date de remise<\/strong>: Voir sur L\u00c9A<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><a href=\"https:\/\/ve2cuy.com\/420-3c3\/?page_id=1247\">R\u00e9f\u00e9rence pour la r\u00e9alisation du TP<\/a><br><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Note<\/mark><\/strong>: Il y a aussi plusieurs exemples de fichiers .BAT dans le groupe de travail sous Teams.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">Mise en situation<\/h2>\n\n\n\n<p>\u00c0 partir du code source suivant:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">@echo off\nREM Fichier: TP01.BAT\nREM --------------------------------------------\nREM Auteur:  Alain Boudreault \nREM Date:    2023.10.23\nREM Version: 1.0\nREM --------------------------------------------\nREM Description: Comme source de d\u00e9part pour le\nREM              travail pratique 01.   \nREM --------------------------------------------\n:: Fond d'\u00e9cran bleu, caract\u00e8res blancs\ncolor 1F\n:: Jeux de caract\u00e8res accentu\u00e9es\ncmd.exe \/c chcp 65001\n:debut\ncls\necho  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\necho  \u2502     Menu principal        \u2502\necho  \u2502                           \u2502\necho  \u2502 (A)fficher le r\u00e9pertoire  \u2502\necho  \u2502 (D)ate du syst\u00e8me         \u2502\necho  \u2502 (T)rier un fichier        \u2502\necho  \u2502 (R)Afficher l'Arbre de C: \u2502\necho  \u2502 (Q)uitter le menu         \u2502\necho  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\necho.\nset option=null\nset \/p option=Option (A\/D\/T\/Q)?\n\nif \/i %option%==q goto quitter\nif \/i %option%==a DIR \/P  \nif \/i %option%==d *** \u00c0 compl\u00e9ter ***\nif \/i %option%==t CALL trier.bat *** \u00c0 compl\u00e9ter ***\nif *** \u00c0 compl\u00e9ter *** \n\necho. \npause\ngoto debut\n:quitter\n<\/pre>\n\n\n\n<p>Ce qui va afficher \u00e0 l&rsquo;\u00e9cran, avec l&rsquo;option T s\u00e9lectionn\u00e9e:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"564\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.08.19.png\" alt=\"\" class=\"wp-image-922\" style=\"aspect-ratio:1.1418439716312057;width:379px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.08.19.png 644w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.08.19-300x263.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"has-vivid-red-color has-text-color\"><strong>\u00c0 vous de compl\u00e9ter les sections manquantes.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Voici ce que doit produire les options du menu:<\/p>\n\n\n\n<p class=\"has-black-color has-text-color\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">A)<\/mark><\/strong> \u00c0 la s\u00e9lection de cette option, il faut saisir le nom d&rsquo;un dossier en relatif ou absolu et afficher le contenu du r\u00e9pertoire et ses sous-r\u00e9pertoires (\/P) \u00e0 l&rsquo;\u00e9cran.  Il faut utiliser l&rsquo;option \/P pour limiter l&rsquo;affichage \u00e0 un \u00e9cran \u00e0 la fois.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"902\" height=\"962\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.43.03.png\" alt=\"\" class=\"wp-image-917\" style=\"aspect-ratio:0.9376299376299376;width:417px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.43.03.png 902w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.43.03-281x300.png 281w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.43.03-768x819.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">D)<\/mark><\/strong> Cette option permet d&rsquo;afficher et de saisir la date du syst\u00e8me.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"104\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.40.19.png\" alt=\"\" class=\"wp-image-916\" style=\"aspect-ratio:5.634615384615385;width:389px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.40.19.png 586w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.40.19-300x53.png 300w\" sizes=\"auto, (max-width: 586px) 100vw, 586px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">T)<\/mark><\/strong> \u00c0 la s\u00e9lection de cette option, il faut saisir le nom d&rsquo;un fichier en relatif ou absolu, et afficher le contenu du fichier trier par ordre d\u00e9croissant \u00e0 l&rsquo;\u00e9cran.<\/p>\n\n\n\n<p>Il faut fournir le fichier &lsquo;<code>amis.txt<\/code>&lsquo; avec l&rsquo;application, dans un sous dossier &lsquo;<code>atrier<\/code>&lsquo;:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"416\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.28.54.png\" alt=\"\" class=\"wp-image-930\" style=\"aspect-ratio:1.7980769230769231;width:389px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.28.54.png 748w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.28.54-300x167.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">R)<\/mark><\/strong> Cette option permet d&rsquo;afficher l&rsquo;arborescence du lecteur C: \u00e0 partir de la racine.  <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Note<\/mark><\/strong>: La commande &lsquo;<code>tree<\/code>&lsquo; permet d&rsquo;afficher l&rsquo;arborescence du syst\u00e8me de fichiers.<\/p>\n\n\n\n<p>Par exemple, pour afficher l&rsquo;arbre \u00e0 partir du dossier <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-cyan-blue-color\">C:\\Moulinsart<\/mark>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"832\" height=\"336\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.38.30.png\" alt=\"\" class=\"wp-image-915\" style=\"aspect-ratio:2.4761904761904763;width:546px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.38.30.png 832w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.38.30-300x121.png 300w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.38.30-768x310.png 768w\" sizes=\"auto, (max-width: 832px) 100vw, 832px\" \/><\/figure>\n<\/div>\n\n\n<p>Il faut limiter l&rsquo;affichage \u00e0 un \u00e9cran \u00e0 la fois.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-purple-color has-text-color\">Gestion des erreurs<\/h2>\n\n\n\n<p>Il faut valider les saisies des noms de fichiers et de dossiers et afficher un message d&rsquo;erreur au besoin:<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">Indice<\/h2>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">set \/p chemin= Donnez le chemin du fichier a trier: \n\nif exist %chemin% (\n\tif %ordre%==c sort %chemin% > fruitsC.txt\n\tif %ordre%==d  sort \/r %chemin% > fruitsD.txt \n\t) else (\t\t\trem ) et ( sur la m\u00eame ligne avec els\n\techo fichier inexistant \n\t)<\/pre>\n\n\n\n<p>Par exemple,<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"690\" height=\"456\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.36.59.png\" alt=\"\" class=\"wp-image-932\" style=\"aspect-ratio:1.513157894736842;width:422px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.36.59.png 690w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-09.36.59-300x198.png 300w\" sizes=\"auto, (max-width: 690px) 100vw, 690px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>Au besoin, il faut valider qu&rsquo;une commande s&rsquo;est bien ex\u00e9cut\u00e9e.<\/p>\n\n\n\n<p><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">Indice<\/mark><\/strong>:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"738\" height=\"338\" src=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.48.41.png\" alt=\"\" class=\"wp-image-918\" style=\"aspect-ratio:2.1834319526627217;width:428px;height:auto\" srcset=\"https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.48.41.png 738w, https:\/\/ve2cuy.com\/wp-content\/uploads\/2023\/10\/Capture-decran-le-2023-10-23-a-08.48.41-300x137.png 300w\" sizes=\"auto, (max-width: 738px) 100vw, 738px\" \/><\/figure>\n<\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-luminous-vivid-orange-color has-text-color\">Points d&rsquo;\u00e9valuation<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Respect du devis<\/li>\n\n\n\n<li>Fonctionnalit\u00e9<\/li>\n\n\n\n<li>Gestion des erreurs<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading has-vivid-cyan-blue-color has-text-color\">Directives de la remise<\/h2>\n\n\n\n<p>Il faut t\u00e9l\u00e9verser sur L\u00c9A, un fichier &lsquo;<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">tp01.zip<\/mark><\/strong>&lsquo; qui contient tous les fichiers du projet.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00c9nonc\u00e9 du TP01 &#8211; Version pr\u00e9liminaire Pond\u00e9ration: 10 %Date de remise: Voir sur L\u00c9A R\u00e9f\u00e9rence pour la r\u00e9alisation du TPNote: Il y a aussi plusieurs exemples de fichiers .BAT dans le groupe de travail sous Teams. Mise en situation \u00c0 partir du code source suivant: Ce qui va afficher \u00e0 l&rsquo;\u00e9cran, avec l&rsquo;option T s\u00e9lectionn\u00e9e: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-911","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/pages\/911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/comments?post=911"}],"version-history":[{"count":13,"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/pages\/911\/revisions"}],"predecessor-version":[{"id":1043,"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/pages\/911\/revisions\/1043"}],"wp:attachment":[{"href":"https:\/\/ve2cuy.com\/index.php\/wp-json\/wp\/v2\/media?parent=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}