Welcome to mirror list, hosted at ThFree Co, Russian Federation.

M020.md « _gcode - github.com/MarlinFirmware/MarlinDocumentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 24ddef56d4e411dba10c09b32db38bda1f826350 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
tag: m0020
title: List SD Card
brief: List the contents of the SD Card.
author: thinkyhead

requires: SDSUPPORT
group: sdcard

codes: [ M20 ]
related: [ M33 ]

notes:
  - Requires [`SDSUPPORT`](/docs/configuration/configuration.html#sd-card)

parameters:
  -
    tag: F
    since: 2.0.9.4
    optional: true
    description: Only list BIN files. Used by host plugins to facilitate firmware upload.
    requires: CUSTOM_FIRMWARE_UPLOAD
    values:
      -
        type: flag
  -
    tag: L
    since: 2.0.9
    experimental: true
    optional: true
    description: Include the long filename in the listing.
    requires: LONG_FILENAME_HOST_SUPPORT
    values:
      -
        type: flag
  -
    tag: T
    since: 2.1.2
    optional: true
    description: Include the file timestamp in the listing.
    requires: M20_TIMESTAMP_SUPPORT
    values:
      -
        type: flag

examples:
  -
    pre: List the contents of the SD card
    post: The firmware will send no other output between "Begin file list" and "End file list."
    code: |
      > M20
      Begin file list
      MYFILE.GCO 14129
      SUBDIR~1/MORETH\~1.GCO 68447
      End file list
      ok
  -
    pre: List files with long filename (for display)
    post: This format produces a prettier File Manager in OctoPrint, but the long name is not used in selecting the file to print, nor are folder long names included.
    code: |
      > M20 L
      Begin file list
      MYFILE.GCO 14129 MyFile.gcode
      SUBDIR~1/MORETH\~1.GCO 68447 Sub Directory/MoretHall.gcode
      End file list
      ok
  -
    pre: List files with file modification timestamp (for display)
    post: OctoPrint 1.9+ uses the timestamp to display file upload times.
    code: |
      > M20 T
      Begin file list
      MYFILE.GCO 14129 0x5515758F
      SUBDIR~1/MORETH\~1.GCO 68447 0x55195745
      End file list
      ok

      > M20 L T
      Begin file list
      MYFILE.GCO 14129 0x5515758F MyFile.gcode
      SUBDIR~1/MORETH\~1.GCO 68447 0x55195745 Sub Directory/MoretHall.gcode
      End file list
      ok

---

List all printable files on the SD card back to the requesting serial port in compact DOS 8.3 format. Only files with `.gcode`, `.gco`, and `.g` extensions will be listed. Hidden files (beginning with `.`) will not be listed.

Hosts or serial controllers should send `M20` to get a DOS 8.3 file listing of the active media device that includes file sizes.

The file size is included in the output since Marlin 1.1.0.