C-style file input/output
De cppreference.com
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
Le sous-ensemble CI / O de la bibliothèque standard C + + met en œuvre des flux d'entrée de style C / opérations de sortie. L'en-tête
<cstdio>
fournit un soutien générique opération de fichier et des fonctions étroites avec les fournitures et multi-octets caractères d'entrée / de sortie des capacités, et l'en-tête <cwchar>
fournit des fonctions d'entrée de caractères larges / capacités de sortie . Original:
The C I/O subset of the C++ standard library implements C-style stream input/output operations. The
<cstdio>
header provides generic file operation support and supplies functions with narrow and multibyte character input/output capabilities, and the <cwchar>
header provides functions with wide character input/output capabilities. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Flux de C sont des objets de std::FILE type qui ne peut être accédé et manipulé par un pointeur de type std::FILE* (Remarque: bien qu'il soit possible de créer un objet local de type de std::FILE par le déréférencement et la copie d'un FILE* valide, en utilisant l'adresse de cette copie dans les fonctions d'E / S est un comportement indéfini). Chaque flux de C est associé à un dispositif physique externe (fichiers, le flux d'entrée standard, une imprimante, un port série, etc) .
Original:
C streams are objects of type std::FILE that can only be accessed and manipulated through pointers of type std::FILE* (Note: while it may be possible to create a local object of type std::FILE by dereferencing and copying a valid FILE*, using the address of such copy in the I/O functions is undefined behavior). Each C stream is associated with an external physical device (file, standard input stream, printer, serial port, etc).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Flux de C peut être utilisé à la fois pour l'entrée non formaté et mis en forme et de sortie. Ils sont locale-sensible et peut effectuer de larges / multi-octets conversions nécessaires. Contrairement à C + + ruisseaux, où chaque flux est associé à son propre locale, tous les flux de C accéder à l'objet même lieu: le plus récemment installé avec std::setlocale .
Original:
C streams can be used for both unformatted and formatted input and output. They are locale-sensitive and may perform wide/multibyte conversions as necessary. Unlike C++ streams, where each stream is associated with its own locale, all C streams access the same locale object: the one most recently installed with std::setlocale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Outre les informations spécifiques au système nécessaire pour accéder à l'appareil (par exemple un descripteur de fichier POSIX), chaque objet de flux C détient les suivantes:
Original:
Besides the system-specific information necessary to access the device (e.g. a POSIX file descriptor), each C stream object holds the following:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
1)
La largeur des caractères: étroit ou large
Original:
Character width: narrow or wide
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
2)
Buffering état: sans tampon, un tampon de ligne, Fully Buffered .
Original:
Buffering state: unbuffered, line-buffered, fully buffered.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
3)
Le tampon, qui peut être remplacé par une source externe, fournie par l'utilisateur tampon .
Original:
The buffer, which may be replaced by an external, user-provided buffer.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
4)
Mode I / O: entrée, sortie ou mise à jour (entrée et sortie) .
Original:
I/O mode: input, output, or update (both input and output).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
5)
Binary / indicateur de mode .
Original:
Binary/text mode indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
6)
Indicateur d'état de fin de fichier .
Original:
End-of-file status indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
7)
Indicateur d'état d'erreur .
Original:
Error status indicator.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
8)
Indicateur de position (un objet de std::fpos_t type), qui, pour les flux de caractères larges, comprend l'état parse (un objet de type mbstate_t) .
Original:
File position indicator (an object of type std::fpos_t), which, for wide character streams, includes the parse state (an object of type mbstate_t).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifier] Fonctions
Original: File access The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
ouvre un fichier Original: opens a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
ouvrir un flux existant sous un nom différent Original: open an existing stream with a different name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
ferme un fichier Original: closes a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
synchronise un flux de sortie avec le fichier réel Original: synchronizes an output stream with the actual file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
passe un flux de fichier entre les caractères larges d'E / S et le caractère étroit I / O Original: switches a file stream between wide character I/O and narrow character I/O The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
définit le tampon pour un flux de fichier Original: sets the buffer for a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
définit le tampon et la taille d'un fichier stream Original: sets the buffer and its size for a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Direct input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lit un fichier Original: reads from a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit dans un fichier Original: writes to a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Unformatted input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Original: Narrow character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
devient un personnage à partir d'un flux de fichier Original: gets a character from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
reçoit une chaîne de caractères à partir d'un flux de fichier Original: gets a character string from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit un caractère dans un flux fichier Original: writes a character to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit une chaîne de caractères dans un flux fichier Original: writes a character string to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
lit un caractère de stdin Original: reads a character from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
lit une chaîne de caractères à partir stdin Original: reads a character string from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit un caractère stdout Original: writes a character to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit une chaîne de caractères à stdout Original: writes a character string to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
met un caractère nouveau dans un flux de fichier Original: puts a character back into a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Wide character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
obtient un caractère large depuis un flux de fichier Original: gets a wide character from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
obtient une chaîne large à partir d'un flux de fichier Original: gets a wide string from a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit un caractère large dans un flux fichier Original: writes a wide character to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit une chaîne de large pour un flux de fichier Original: writes a wide string to a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
lit un caractère large depuis stdin Original: reads a wide character from stdin The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
écrit un caractère large stdout Original: writes a wide character to stdout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
met un caractère large en arrière dans un flux de fichier Original: puts a wide character back into a file stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Formatted input/output The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
Original: Narrow/multibyte character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lit l'entrée en forme à partir stdin, un flux de fichier ou un tampon Original: reads formatted input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
(C++11) (C++11) (C++11) |
lit l'entrée en forme à partir stdin, un flux ou un fichier en utilisant buffer liste d'arguments variable Original: reads formatted input from stdin, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
impressions en forme de sortie de stdout, un flux de fichier ou d'un tampon Original: prints formatted output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
(C++11) |
impressions formaté à stdout, un flux ou un fichier en utilisant buffer liste d'arguments variable Original: prints formatted output to stdout, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
Original: Wide character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
lit format d'entrée pour les caractères larges de stdin, un flux de fichier ou un tampon Original: reads formatted wide character input from stdin, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
(C++11) (C++11) (C++11) |
lit format d'entrée pour les caractères larges de stdin, un stream fichier ou un tampon en utilisant la liste d'arguments variable Original: reads formatted wide character input from stdin, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
impressions en forme de sortie de caractères étendus pour stdout, un flux de fichier ou d'un tampon Original: prints formatted wide character output to stdout, a file stream or a buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
impressions résultat formaté caractère large stdout, un stream fichier ou un tampon en utilisant la liste d'arguments variable Original: prints formatted wide character output to stdout, a file stream or a buffer using variable argument list The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: File positioning The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
renvoie l'indicateur de position de fichier courant Original: returns the current file position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
obtient l'indicateur de position Original: gets the file position indicator The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
déplace l'indicateur de position de fichier à un emplacement spécifique dans un fichier Original: moves the file position indicator to a specific location in a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
déplace l'indicateur de position de fichier à un emplacement spécifique dans un fichier Original: moves the file position indicator to a specific location in a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
déplace l'indicateur de position de fichier au début d'un fichier Original: moves the file position indicator to the beginning in a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Error handling The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
efface les erreurs Original: clears errors The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
contrôle de la fin de fichier Original: checks for the end-of-file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
chèques pour une erreur de fichier Original: checks for a file error The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
affiche une chaîne de caractères correspondant de l'erreur de courant à stderr Original: displays a character string corresponding of the current error to stderr The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
Original: Operations on files The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
efface un fichier Original: erases a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
renomme un fichier Original: renames a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
crée et ouvre un temporaire, auto-suppression du fichier Original: creates and opens a temporary, auto-removing file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) | |
retourne un nom de fichier unique Original: returns a unique filename The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction) |
[modifier] Types
Defined in header
<cstdio> | |
Type d'
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Definition |
FILE | type, capable de contenir toutes les informations nécessaires pour contrôler un flux CI / O
Original: type, capable of holding all information needed to control a C I/O stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
fpos_t | le type, capable de spécifier de manière unique une position d'une image
Original: type, capable of uniquely specifying a position in a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier] Macros
Defined in header
<cstdio> | |
stdin stdout stderr |
expression de type associé à la FILE* stream expression entrée de FILE* type associé à la sortie de stream expression FILE* type associé au flux de sortie d'erreur Original: expression of type FILE* associated with the input stream expression of type FILE* associated with the output stream expression of type FILE* associated with the error output stream The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
EOF |
expression constante de nombre entier int type et la valeur négative Original: integer constant expression of type int and negative value The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
FOPEN_MAX |
nombre de fichiers qui peuvent être ouverts simultanément Original: number of files that can be open simultaneously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
FILENAME_MAX |
taille nécessaire pour un tableau de char de tenir le plus long nom de fichier pris en charge Original: size needed for an array of char to hold the longest supported file name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
BUFSIZ |
taille du buffer utilisé par std::setbuf Original: size of the buffer used by std::setbuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
_IOFBF _IOLBF _IONBF |
argument pour std::setbuf indiquant fully buffered I / O argument à la ligne std::setbuf indiquant tampon d'E / O argument à std::setbuf indiquant mémoire sans tampon I / O Original: argument to std::setbuf indicating fully buffered I/O argument to std::setbuf indicating line buffered I/O argument to std::setbuf indicating unbuffered I/O The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
SEEK_SET SEEK_CUR SEEK_END |
argument pour std::fseek indiquant cherche depuis le début de l'file argument à std::fseek indiquant la recherche de la position argument fichier en cours std::fseek indiquant la recherche à partir de la fin du fichier Original: argument to std::fseek indicating seeking from beginning of the file argument to std::fseek indicating seeking from the current file position argument to std::fseek indicating seeking from end of the file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
TMP_MAX |
nombre maximum de noms de fichiers uniques pouvant être générés par std::tmpnam Original: maximum number of unique filenames that can be generated by std::tmpnam The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |
L_tmpnam |
taille nécessaire pour un tableau de char pour contenir le résultat de std::tmpnam Original: size needed for an array of char to hold the result of std::tmpnam The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (constante macro) |