diff options
Diffstat (limited to 'templates/man2/ioctl_fat.2.pot')
-rw-r--r-- | templates/man2/ioctl_fat.2.pot | 1228 |
1 files changed, 1228 insertions, 0 deletions
diff --git a/templates/man2/ioctl_fat.2.pot b/templates/man2/ioctl_fat.2.pot new file mode 100644 index 00000000..774732c3 --- /dev/null +++ b/templates/man2/ioctl_fat.2.pot @@ -0,0 +1,1228 @@ +# SOME DESCRIPTIVE TITLE +# Copyright (C) YEAR Free Software Foundation, Inc. +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2024-03-01 16:59+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. type: TH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "ioctl_fat" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "2023-10-31" +msgstr "" + +#. type: TH +#: archlinux fedora-40 fedora-rawhide mageia-cauldron +#, no-wrap +msgid "Linux man-pages 6.06" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "NAME" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "ioctl_fat - manipulating the FAT filesystem" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "LIBRARY" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "Standard C library (I<libc>, I<-lc>)" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SYNOPSIS" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<#include E<lt>linux/msdos_fs.hE<gt>> /* Definition of [B<V>]B<FAT_*> and\n" +"B< ATTR_* >constantsB<*/\">\n" +"B<#include E<lt>sys/ioctl.hE<gt>>\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"B<int ioctl(int >I<fd>B<, FAT_IOCTL_GET_ATTRIBUTES, uint32_t *>I<attr>B<);>\n" +"B<int ioctl(int >I<fd>B<, FAT_IOCTL_SET_ATTRIBUTES, uint32_t *>I<attr>B<);>\n" +"B<int ioctl(int >I<fd>B<, FAT_IOCTL_GET_VOLUME_ID, uint32_t *>I<id>B<);>\n" +"B<int ioctl(int >I<fd>B<, VFAT_IOCTL_READDIR_BOTH,>\n" +"B< struct __fat_dirent >I<entry>B<[2]);>\n" +"B<int ioctl(int >I<fd>B<, VFAT_IOCTL_READDIR_SHORT,>\n" +"B< struct __fat_dirent >I<entry>B<[2]);>\n" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "DESCRIPTION" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The B<ioctl>(2) system call can be used to read and write metadata of FAT " +"filesystems that are not accessible using other system calls." +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Reading and setting file attributes" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"Files and directories in the FAT filesystem possess an attribute bit mask " +"that can be read with B<FAT_IOCTL_GET_ATTRIBUTES> and written with " +"B<FAT_IOCTL_SET_ATTRIBUTES>." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<fd> argument contains a file descriptor for a file or directory. It " +"is sufficient to create the file descriptor by calling B<open>(2) with the " +"B<O_RDONLY> flag." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<attr> argument contains a pointer to a bit mask. The bits of the bit " +"mask are:" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_RO>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "This bit specifies that the file or directory is read-only." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_HIDDEN>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "This bit specifies that the file or directory is hidden." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_SYS>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "This bit specifies that the file is a system file." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_VOLUME>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This bit specifies that the file is a volume label. This attribute is read-" +"only." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_DIR>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This bit specifies that this is a directory. This attribute is read-only." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ATTR_ARCH>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This bit indicates that this file or directory should be archived. It is " +"set when a file is created or modified. It is reset by an archiving system." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The zero value B<ATTR_NONE> can be used to indicate that no attribute bit is " +"set." +msgstr "" + +#. SRC END +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Reading the volume ID" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"FAT filesystems are identified by a volume ID. The volume ID can be read " +"with B<FAT_IOCTL_GET_VOLUME_ID>." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<fd> argument can be a file descriptor for any file or directory of the " +"filesystem. It is sufficient to create the file descriptor by calling " +"B<open>(2) with the B<O_RDONLY> flag." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<id> argument is a pointer to the field that will be filled with the " +"volume ID. Typically the volume ID is displayed to the user as a group of " +"two 16-bit fields:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "printf(\"Volume ID %04x-%04x\\en\", id E<gt>E<gt> 16, id & 0xFFFF);\n" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Reading short filenames of a directory" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"A file or directory on a FAT filesystem always has a short filename " +"consisting of up to 8 capital letters, optionally followed by a period and " +"up to 3 capital letters for the file extension. If the actual filename does " +"not fit into this scheme, it is stored as a long filename of up to 255 " +"UTF-16 characters." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The short filenames in a directory can be read with " +"B<VFAT_IOCTL_READDIR_SHORT>. B<VFAT_IOCTL_READDIR_BOTH> reads both the " +"short and the long filenames." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<fd> argument must be a file descriptor for a directory. It is " +"sufficient to create the file descriptor by calling B<open>(2) with the " +"B<O_RDONLY> flag. The file descriptor can be used only once to iterate over " +"the directory entries by calling B<ioctl>(2) repeatedly." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<entry> argument is a two-element array of the following structures:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"struct __fat_dirent {\n" +" long d_ino;\n" +" __kernel_off_t d_off;\n" +" uint32_t short d_reclen;\n" +" char d_name[256];\n" +"};\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The first entry in the array is for the short filename. The second entry is " +"for the long filename." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The I<d_ino> and I<d_off> fields are filled only for long filenames. The " +"I<d_ino> field holds the inode number of the directory. The I<d_off> field " +"holds the offset of the file entry in the directory. As these values are " +"not available for short filenames, the user code should simply ignore them." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The field I<d_reclen> contains the length of the filename in the field " +"I<d_name>. To keep backward compatibility, a length of 0 for the short " +"filename signals that the end of the directory has been reached. However, " +"the preferred method for detecting the end of the directory is to test the " +"B<ioctl>(2) return value. If no long filename exists, field I<d_reclen> is " +"set to 0 and I<d_name> is a character string of length 0 for the long " +"filename." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "RETURN VALUE" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "On error, -1 is returned, and I<errno> is set to indicate the error." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"For B<VFAT_IOCTL_READDIR_BOTH> and B<VFAT_IOCTL_READDIR_SHORT> a return " +"value of 1 signals that a new directory entry has been read and a return " +"value of 0 signals that the end of the directory has been reached." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "ERRORS" +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOENT>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This error is returned by B<VFAT_IOCTL_READDIR_BOTH> and " +"B<VFAT_IOCTL_READDIR_SHORT> if the file descriptor I<fd> refers to a " +"removed, but still open directory." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOTDIR>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"This error is returned by B<VFAT_IOCTL_READDIR_BOTH> and " +"B<VFAT_IOCTL_READDIR_SHORT> if the file descriptor I<fd> does not refer to a " +"directory." +msgstr "" + +#. type: TP +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<ENOTTY>" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The file descriptor I<fd> does not refer to an object in a FAT filesystem." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "For further error values, see B<ioctl>(2)." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "STANDARDS" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux." +msgstr "" + +#. type: SH +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "HISTORY" +msgstr "" + +#. type: TP +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<VFAT_IOCTL_READDIR_BOTH>" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<VFAT_IOCTL_READDIR_SHORT>" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux 2.0." +msgstr "" + +#. type: TP +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAT_IOCTL_GET_ATTRIBUTES>" +msgstr "" + +#. type: TQ +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAT_IOCTL_SET_ATTRIBUTES>" +msgstr "" + +#. just before we got Git history +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux 2.6.12." +msgstr "" + +#. type: TP +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "B<FAT_IOCTL_GET_VOLUME_ID>" +msgstr "" + +#. commit 6e5b93ee55d401f1619092fb675b57c28c9ed7ec +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-leap-15-6 opensuse-tumbleweed +msgid "Linux 3.11." +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "EXAMPLES" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Toggling the archive flag" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following program demonstrates the usage of B<ioctl>(2) to manipulate " +"file attributes. The program reads and displays the archive attribute of a " +"file. After inverting the value of the attribute, the program reads and " +"displays the attribute again." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following was recorded when applying the program for the file I</mnt/" +"user/foo>:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"# ./toggle_fat_archive_flag /mnt/user/foo\n" +"Archive flag is set\n" +"Toggling archive flag\n" +"Archive flag is not set\n" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Program source (toggle_fat_archive_flag.c)" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>linux/msdos_fs.hE<gt>\n" +"#include E<lt>stdint.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/ioctl.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"/*\n" +" * Read file attributes of a file on a FAT filesystem.\n" +" * Output the state of the archive flag.\n" +" */\n" +"static uint32_t\n" +"readattr(int fd)\n" +"{\n" +" int ret;\n" +" uint32_t attr;\n" +"\\&\n" +" ret = ioctl(fd, FAT_IOCTL_GET_ATTRIBUTES, &attr);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" if (attr & ATTR_ARCH)\n" +" printf(\"Archive flag is set\\en\");\n" +" else\n" +" printf(\"Archive flag is not set\\en\");\n" +"\\&\n" +" return attr;\n" +"}\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" uint32_t attr;\n" +"\\&\n" +" if (argc != 2) {\n" +" printf(\"Usage: %s FILENAME\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" fd = open(argv[1], O_RDONLY);\n" +" if (fd == -1) {\n" +" perror(\"open\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Read and display the FAT file attributes.\n" +" */\n" +" attr = readattr(fd);\n" +"\\&\n" +" /*\n" +" * Invert archive attribute.\n" +" */\n" +" printf(\"Toggling archive flag\\en\");\n" +" attr \\[ha]= ATTR_ARCH;\n" +"\\&\n" +" /*\n" +" * Write the changed FAT file attributes.\n" +" */\n" +" ret = ioctl(fd, FAT_IOCTL_SET_ATTRIBUTES, &attr);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Read and display the FAT file attributes.\n" +" */\n" +" readattr(fd);\n" +"\\&\n" +" close(fd);\n" +"\\&\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following program demonstrates the use of B<ioctl>(2) to display the " +"volume ID of a FAT filesystem." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following output was recorded when applying the program for directory I</" +"mnt/user>:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"$ ./display_fat_volume_id /mnt/user\n" +"Volume ID 6443-6241\n" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Program source (display_fat_volume_id.c)" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>linux/msdos_fs.hE<gt>\n" +"#include E<lt>stdint.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/ioctl.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" uint32_t id;\n" +"\\&\n" +" if (argc != 2) {\n" +" printf(\"Usage: %s FILENAME\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" fd = open(argv[1], O_RDONLY);\n" +" if (fd == -1) {\n" +" perror(\"open\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Read volume ID.\n" +" */\n" +" ret = ioctl(fd, FAT_IOCTL_GET_VOLUME_ID, &id);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Format the output as two groups of 16 bits each.\n" +" */\n" +" printf(\"Volume ID %04x-%04x\\en\", id E<gt>E<gt> 16, id & 0xFFFF);\n" +"\\&\n" +" close(fd);\n" +"\\&\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. SRC END +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Listing a directory" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following program demonstrates the use of B<ioctl>(2) to list a " +"directory." +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "" +"The following was recorded when applying the program to the directory I</mnt/" +"user>:" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "" +"$ B<./fat_dir /mnt/user>\n" +"\\&. -E<gt> \\[aq]\\[aq]\n" +"\\&.. -E<gt> \\[aq]\\[aq]\n" +"ALONGF\\[ti]1.TXT -E<gt> \\[aq]a long filename.txt\\[aq]\n" +"UPPER.TXT -E<gt> \\[aq]\\[aq]\n" +"LOWER.TXT -E<gt> \\[aq]lower.txt\\[aq]\n" +msgstr "" + +#. type: SS +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "Program source" +msgstr "" + +#. type: Plain text +#: archlinux debian-unstable fedora-40 fedora-rawhide mageia-cauldron +#: opensuse-tumbleweed +#, no-wrap +msgid "" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>linux/msdos_fs.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/ioctl.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +"\\&\n" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" struct __fat_dirent entry[2];\n" +"\\&\n" +" if (argc != 2) {\n" +" printf(\"Usage: %s DIRECTORY\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Open file descriptor for the directory.\n" +" */\n" +" fd = open(argv[1], O_RDONLY | O_DIRECTORY);\n" +" if (fd == -1) {\n" +" perror(\"open\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" for (;;) {\n" +"\\&\n" +" /*\n" +" * Read next directory entry.\n" +" */\n" +" ret = ioctl(fd, VFAT_IOCTL_READDIR_BOTH, entry);\n" +"\\&\n" +" /*\n" +" * If an error occurs, the return value is -1.\n" +" * If the end of the directory list has been reached,\n" +" * the return value is 0.\n" +" * For backward compatibility the end of the directory\n" +" * list is also signaled by d_reclen == 0.\n" +" */\n" +" if (ret E<lt> 1)\n" +" break;\n" +"\\&\n" +" /*\n" +" * Write both the short name and the long name.\n" +" */\n" +" printf(\"%s -E<gt> \\[aq]%s\\[aq]\\en\", entry[0].d_name, entry[1].d_name);\n" +" }\n" +"\\&\n" +" if (ret == -1) {\n" +" perror(\"VFAT_IOCTL_READDIR_BOTH\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +"\\&\n" +" /*\n" +" * Close the file descriptor.\n" +" */\n" +" close(fd);\n" +"\\&\n" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: SH +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +#, no-wrap +msgid "SEE ALSO" +msgstr "" + +#. type: Plain text +#: archlinux debian-bookworm debian-unstable fedora-40 fedora-rawhide +#: mageia-cauldron opensuse-leap-15-6 opensuse-tumbleweed +msgid "B<ioctl>(2)" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "2023-02-10" +msgstr "" + +#. type: TH +#: debian-bookworm +#, no-wrap +msgid "Linux man-pages 6.03" +msgstr "" + +#. type: SH +#: debian-bookworm +#, no-wrap +msgid "VERSIONS" +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "" +"B<VFAT_IOCTL_READDIR_BOTH> and B<VFAT_IOCTL_READDIR_SHORT> first appeared in " +"Linux 2.0." +msgstr "" + +#. just before we got Git history +#. type: Plain text +#: debian-bookworm +msgid "" +"B<FAT_IOCTL_GET_ATTRIBUTES> and B<FAT_IOCTL_SET_ATTRIBUTES> first appeared " +"in Linux 2.6.12." +msgstr "" + +#. commit 6e5b93ee55d401f1619092fb675b57c28c9ed7ec +#. type: Plain text +#: debian-bookworm +msgid "" +"B<FAT_IOCTL_GET_VOLUME_ID> was introduced in version 3.11 of the Linux " +"kernel." +msgstr "" + +#. type: Plain text +#: debian-bookworm +msgid "This API is Linux-specific." +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>linux/msdos_fs.hE<gt>\n" +"#include E<lt>stdint.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/ioctl.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"/*\n" +" * Read file attributes of a file on a FAT filesystem.\n" +" * Output the state of the archive flag.\n" +" */\n" +"static uint32_t\n" +"readattr(int fd)\n" +"{\n" +" int ret;\n" +" uint32_t attr;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" ret = ioctl(fd, FAT_IOCTL_GET_ATTRIBUTES, &attr);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (attr & ATTR_ARCH)\n" +" printf(\"Archive flag is set\\en\");\n" +" else\n" +" printf(\"Archive flag is not set\\en\");\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" return attr;\n" +"}\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" uint32_t attr;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (argc != 2) {\n" +" printf(\"Usage: %s FILENAME\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" fd = open(argv[1], O_RDONLY);\n" +" if (fd == -1) {\n" +" perror(\"open\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Read and display the FAT file attributes.\n" +" */\n" +" attr = readattr(fd);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Invert archive attribute.\n" +" */\n" +" printf(\"Toggling archive flag\\en\");\n" +" attr \\[ha]= ATTR_ARCH;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Write the changed FAT file attributes.\n" +" */\n" +" ret = ioctl(fd, FAT_IOCTL_SET_ATTRIBUTES, &attr);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Read and display the FAT file attributes.\n" +" */\n" +" readattr(fd);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " close(fd);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" exit(EXIT_SUCCESS);\n" +"}\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" uint32_t id;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Read volume ID.\n" +" */\n" +" ret = ioctl(fd, FAT_IOCTL_GET_VOLUME_ID, &id);\n" +" if (ret == -1) {\n" +" perror(\"ioctl\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Format the output as two groups of 16 bits each.\n" +" */\n" +" printf(\"Volume ID %04x-%04x\\en\", id E<gt>E<gt> 16, id & 0xFFFF);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"#include E<lt>fcntl.hE<gt>\n" +"#include E<lt>linux/msdos_fs.hE<gt>\n" +"#include E<lt>stdio.hE<gt>\n" +"#include E<lt>stdlib.hE<gt>\n" +"#include E<lt>sys/ioctl.hE<gt>\n" +"#include E<lt>unistd.hE<gt>\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +"int\n" +"main(int argc, char *argv[])\n" +"{\n" +" int fd;\n" +" int ret;\n" +" struct __fat_dirent entry[2];\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (argc != 2) {\n" +" printf(\"Usage: %s DIRECTORY\\en\", argv[0]);\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Open file descriptor for the directory.\n" +" */\n" +" fd = open(argv[1], O_RDONLY | O_DIRECTORY);\n" +" if (fd == -1) {\n" +" perror(\"open\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid " for (;;) {\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Read next directory entry.\n" +" */\n" +" ret = ioctl(fd, VFAT_IOCTL_READDIR_BOTH, entry);\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * If an error occurs, the return value is -1.\n" +" * If the end of the directory list has been reached,\n" +" * the return value is 0.\n" +" * For backward compatibility the end of the directory\n" +" * list is also signaled by d_reclen == 0.\n" +" */\n" +" if (ret E<lt> 1)\n" +" break;\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Write both the short name and the long name.\n" +" */\n" +" printf(\"%s -E<gt> \\[aq]%s\\[aq]\\en\", entry[0].d_name, entry[1].d_name);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" if (ret == -1) {\n" +" perror(\"VFAT_IOCTL_READDIR_BOTH\");\n" +" exit(EXIT_FAILURE);\n" +" }\n" +msgstr "" + +#. type: Plain text +#: debian-bookworm opensuse-leap-15-6 +#, no-wrap +msgid "" +" /*\n" +" * Close the file descriptor.\n" +" */\n" +" close(fd);\n" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "2023-05-03" +msgstr "" + +#. type: TH +#: debian-unstable opensuse-tumbleweed +#, no-wrap +msgid "Linux man-pages 6.05.01" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "2023-03-30" +msgstr "" + +#. type: TH +#: opensuse-leap-15-6 +#, no-wrap +msgid "Linux man-pages 6.04" +msgstr "" |