ursus contionabundo: Perl Filesystem Encoding erkennen

Beitrag lesen

Wie befragt man denn das OS nach der Dateisystemkodierung?

Eigentlich gar nicht. Unter Linux macht das der Kernel. ggf. nochmal die Shell.

/etc/default.locale zeigt: LANG="de_DE.UTF-8". Daran hält sich auch Perl.

Ausnahmen für schräge Dateisysteme unter Linux:

Mount options for fat

codepage=value

  • Sets the codepage for converting to shortname characters on FAT and VFAT filesystems. By default, codepage 437 is used.

iocharset=value

  • Character set to use for converting between 8 bit characters and 16 bit Unicode characters. The default is iso8859-1. Long filenames are stored on disk in Unicode format.

Mount options for iso9660

iocharset=value

  • Character set to use for converting 16 bit Unicode characters on CD to 8 bit characters. The default is iso8859-1.

utf8

  • Convert 16 bit Unicode characters on CD to UTF-8.

Mount options for jfs

iocharset=name

  • Character set to use for converting from Unicode to ASCII. The default is to do no conversion. Use iocharset=utf8 for UTF8 translations. This requires CONFIG_NLS_UTF8 to be set in the kernel .config file.

Mount options for ntfs

iocharset=name

  • Character set to use when returning file names. Unlike VFAT, NTFS suppresses names that contain nonconvertible characters. Deprecated.

nls=name

  • New name for the option earlier called iocharset.

utf8

  • Use UTF-8 for converting file names.

uni_xlate={0|1|2}

  • For 0 (or no' or false'), do not use escape sequences for unknown Unicode characters. For 1 (or yes' or true') or 2, use vfat-style 4-byte escape sequences starting with ":". Here 2 give a little-endian encoding and 1 a byteswapped bigendian encoding.

posix=[0\1]

  • If enabled (posix=1), the filesystem distinguishes between upper and lower case. The 8.3 alias names are presented as hard links instead of being suppressed. This option is obsolete.

Mount options for vfat

First of all, the mount options for fat are recognized. The dotsOK option is explicitly killed by vfat. Furthermore, there are

uni_xlate

  • Translate unhandled Unicode characters to special escaped sequences. This lets you backup and restore filenames that are created with any Unicode characters. Without this option, a '?' is used when no translation is possible. The escape character is ':' because it is otherwise invalid on the vfat filesystem. The escape sequence that gets used, where u is the Unicode charac‐ter, is: ':', (u & 0x3f), ((u>>6) & 0x3f), (u>>12).

Hat man also ein Windows-Dateisystem unter Linux und will es wissen kann man die Ausgaben von mount nach den Dateisystemen filtern und die Zeilen parsen.

Hint:

mount | grep -P "^$(df /home | cut -d ' ' -f1 | tail -n1) "

holt die Zeile für ein bestimmtes Verzeichnis (hier: /home). Das Leerzeichen am Ende des Strings passt.

0 92

Perl Filesystem Encoding erkennen

beatovich
  • perl
  1. 0
    dedlfix
    1. 0
      beatovich
      1. 0
        pl
      2. 0
        pl
        1. 0
          beatovich
          1. 0
            pl
            1. 0
              beatovich
              1. 0
                pl
                1. 0
                  beatovich
                  1. 0
                    pl
                    1. 0
                      pl
                      1. 0
                        beatovich
                    2. 0
                      beatovich
                      1. 0
                        pl
                        1. 0
                          beatovich
                          1. 0
                            pl
                            1. 0
                              beatovich
                              1. 0
                                Tabellenkalk
                              2. 0
                                pl
                                1. 0
                                  beatovich
                                2. 0
                                  beatovich
                                  1. 0
                                    pl
                                    1. 0
                                      beatovich
                                      1. 0
                                        pl
                                        1. 0
                                          beatovich
                                          1. -2
                                            pl
                                            1. 0
                                              beatovich
                                              1. 0
                                                pl
                                              2. 1
                                                Rolf B
                                                1. 0
                                                  beatovich
                                                  1. 0
                                                    Rolf B
                                                    1. 0
                                                      beatovich
                                                    2. -1
                                                      pl
                                                      1. 0
                                                        beatovich
                                                        1. -1
                                                          pl
                                                      2. 1
                                                        Rolf B
                                                        1. -1
                                                          pl
                                                          1. 0
                                                            Rolf B
                                                            1. 0
                                                              beatovich
                                                              1. 0
                                                                Rolf B
                                                                1. 0
                                                                  beatovich
                                                                  1. 0
                                                                    Rolf B
                                                            2. 0
                                                              pl
                                                        2. -1
                                                          pl
                                                        3. 0
                                                          pl
                                                          1. 0
                                                            dedlfix
                                                            1. 0
                                                              pl
                                                              1. 1
                                                                dedlfix
                                                                1. 0
                                                                  pl
    2. 1
      ursus contionabundo
      1. 0
        ursus contionabundo
        1. 0
          TS
          • dateisystem
          • perl
          1. 0
            ursus contionabundo
        2. 0
          Robert B.
          1. 0
            pl
            1. 1
              Matthias Apsel
              • sonstiges
              1. -1
                pl
                1. 0
                  dedlfix
                  1. 0
                    pl
                    1. 0
                      dedlfix
                      1. 0
                        pl
                        1. 0
                          dedlfix
                          1. -1
                            pl
                            1. 0
                              dedlfix
                              1. 0
                                pl
                            2. 0
                              Christian Kruse
                              1. -1

                                Woran erkennt man einen Bug

                                pl
                                1. 0
                                  dedlfix
                                  1. 0
                                    Rolf B
                                    1. -3
                                      pl
                                      1. 1
                                        Robert B.
                                  2. 0
                                    pl
                                  3. 0

                                    Woran erkennt man einen Bug, updated

                                    pl
                                    1. 0
                                      dedlfix
                                      1. -1
                                        pl
                                2. 6
                                  Christian Kruse
                                  1. -2
                                    pl
                                    1. 5
                                      Christian Kruse
                2. 0
                  beatovich
                3. 0
                  Robert B.
                  1. 0

                    Systematische Fehler

                    pl
                    1. 0
                      Robert B.
            2. 0
              Robert B.
          2. 0
            ursus contionabundo
            1. 0
              Robert B.
  2. 0
    TS
  3. 0
    pl
  4. 0
    klawischnigg
    1. 0
      pl
      1. 0
        klawischnigg
        1. -1
          pl