Главная » Просмотр файлов » Стандарт языка Си С99 TC

Стандарт языка Си С99 TC (1113411), страница 49

Файл №1113411 Стандарт языка Си С99 TC (Стандарт языка Си С99 + TC) 49 страницаСтандарт языка Си С99 TC (1113411) страница 492019-04-24СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 49)

A successful call to fgetpos stores a representation of thevalue of this mbstate_t object as part of the value of the fpos_t object. A latersuccessful call to fsetpos using the same stored fpos_t value restores the value ofthe associated mbstate_t object as well as the position within the controlled stream.Environmental limits7An implementation shall support text files with lines containing at least 254 characters,including the terminating new-line character. The value of the macro BUFSIZ shall be atleast 256.Forward references: the freopen function (7.19.5.4), the fwide function (7.24.3.5),mbstate_t (7.25.1), the fgetpos function (7.19.9.1), the fsetpos function(7.19.9.3).233) The three predefined streams stdin, stdout, and stderr are unoriented at program startup.§7.19.2Library265ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N12567.19.3 Files1A stream is associated with an external file (which may be a physical device) by openinga file, which may involve creating a new file.

Creating an existing file causes its formercontents to be discarded, if necessary. If a file can support positioning requests (such as adisk file, as opposed to a terminal), then a file position indicator associated with thestream is positioned at the start (character number zero) of the file, unless the file isopened with append mode in which case it is implementation-defined whether the fileposition indicator is initially positioned at the beginning or the end of the file. The fileposition indicator is maintained by subsequent reads, writes, and positioning requests, tofacilitate an orderly progression through the file.2Binary files are not truncated, except as defined in 7.19.5.3.

Whether a write on a textstream causes the associated file to be truncated beyond that point is implementationdefined.3When a stream is unbuffered, characters are intended to appear from the source or at thedestination as soon as possible. Otherwise characters may be accumulated andtransmitted to or from the host environment as a block. When a stream is fully buffered,characters are intended to be transmitted to or from the host environment as a block whena buffer is filled. When a stream is line buffered, characters are intended to betransmitted to or from the host environment as a block when a new-line character isencountered. Furthermore, characters are intended to be transmitted as a block to the hostenvironment when a buffer is filled, when input is requested on an unbuffered stream, orwhen input is requested on a line buffered stream that requires the transmission ofcharacters from the host environment. Support for these characteristics isimplementation-defined, and may be affected via the setbuf and setvbuf functions.4A file may be disassociated from a controlling stream by closing the file.

Output streamsare flushed (any unwritten buffer contents are transmitted to the host environment) beforethe stream is disassociated from the file. The value of a pointer to a FILE object isindeterminate after the associated file is closed (including the standard text streams).Whether a file of zero length (on which no characters have been written by an outputstream) actually exists is implementation-defined.5The file may be subsequently reopened, by the same or another program execution, andits contents reclaimed or modified (if it can be repositioned at its start). If the mainfunction returns to its original caller, or if the exit function is called, all open files areclosed (hence all output streams are flushed) before program termination.

Other paths toprogram termination, such as calling the abort function, need not close all filesproperly.6The address of the FILE object used to control a stream may be significant; a copy of aFILE object need not serve in place of the original.266Library§7.19.3WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC37At program startup, three text streams are predefined and need not be opened explicitly— standard input (for reading conventional input), standard output (for writingconventional output), and standard error (for writing diagnostic output).

As initiallyopened, the standard error stream is not fully buffered; the standard input and standardoutput streams are fully buffered if and only if the stream can be determined not to referto an interactive device.8Functions that open additional (nontemporary) files require a file name, which is a string.The rules for composing valid file names are implementation-defined.

Whether the samefile can be simultaneously open multiple times is also implementation-defined.9Although both text and binary wide-oriented streams are conceptually sequences of widecharacters, the external file associated with a wide-oriented stream is a sequence ofmultibyte characters, generalized as follows:— Multibyte encodings within files may contain embedded null bytes (unlike multibyteencodings valid for use internal to the program).— A file need not begin nor end in the initial shift state.234)10Moreover, the encodings used for multibyte characters may differ among files. Both thenature and choice of such encodings are implementation-defined.11The wide character input functions read multibyte characters from the stream and convertthem to wide characters as if they were read by successive calls to the fgetwc function.Each conversion occurs as if by a call to the mbrtowc function, with the conversion statedescribed by the stream’s own mbstate_t object.

The byte input functions readcharacters from the stream as if by successive calls to the fgetc function.12The wide character output functions convert wide characters to multibyte characters andwrite them to the stream as if they were written by successive calls to the fputwcfunction.

Each conversion occurs as if by a call to the wcrtomb function, with theconversion state described by the stream’s own mbstate_t object. The byte outputfunctions write characters to the stream as if by successive calls to the fputc function.13In some cases, some of the byte input/output functions also perform conversions betweenmultibyte characters and wide characters. These conversions also occur as if by calls tothe mbrtowc and wcrtomb functions.14An encoding error occurs if the character sequence presented to the underlyingmbrtowc function does not form a valid (generalized) multibyte character, or if the codevalue passed to the underlying wcrtomb does not correspond to a valid (generalized)234) Setting the file position indicator to end-of-file, as with fseek(file, 0, SEEK_END), hasundefined behavior for a binary stream (because of possible trailing null characters) or for any streamwith state-dependent encoding that does not assuredly end in the initial shift state.§7.19.3Library267ISO/IEC 9899:TC3Committee Draft — Septermber 7, 2007WG14/N1256multibyte character.

The wide character input/output functions and the byte input/outputfunctions store the value of the macro EILSEQ in errno if and only if an encoding erroroccurs.Environmental limits15The value of FOPEN_MAX shall be at least eight, including the three standard textstreams.Forward references: the exit function (7.20.4.3), the fgetc function (7.19.7.1), thefopen function (7.19.5.3), the fputc function (7.19.7.3), the setbuf function(7.19.5.5), the setvbuf function (7.19.5.6), the fgetwc function (7.24.3.1), thefputwc function (7.24.3.3), conversion state (7.24.6), the mbrtowc function(7.24.6.3.2), the wcrtomb function (7.24.6.3.3).7.19.4 Operations on files7.19.4.1 The remove functionSynopsis1#include <stdio.h>int remove(const char *filename);Description2The remove function causes the file whose name is the string pointed to by filenameto be no longer accessible by that name.

A subsequent attempt to open that file using thatname will fail, unless it is created anew. If the file is open, the behavior of the removefunction is implementation-defined.Returns3The remove function returns zero if the operation succeeds, nonzero if it fails.7.19.4.2 The rename functionSynopsis1#include <stdio.h>int rename(const char *old, const char *new);Description2The rename function causes the file whose name is the string pointed to by old to behenceforth known by the name given by the string pointed to by new. The file namedold is no longer accessible by that name.

If a file named by the string pointed to by newexists prior to the call to the rename function, the behavior is implementation-defined.268Library§7.19.4.2WG14/N1256Committee Draft — Septermber 7, 2007ISO/IEC 9899:TC3Returns3The rename function returns zero if the operation succeeds, nonzero if it fails,235) inwhich case if the file existed previously it is still known by its original name.7.19.4.3 The tmpfile functionSynopsis1#include <stdio.h>FILE *tmpfile(void);Description2The tmpfile function creates a temporary binary file that is different from any otherexisting file and that will automatically be removed when it is closed or at programtermination.

Характеристики

Тип файла
PDF-файл
Размер
3,61 Mb
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее