当输入文件中没有其他字符可供读取时,循环结束。
The loop completes when there are no more characters to read in the in file.
若要使用这个库,可以打开此文档并读取文件,然后依次循环主控制块内的每个块,如清单1所示。
You use the library by opening the document and reading the file, followed by looping through each block in the main control block, as shown in Listing 1.
现在,要从全部共享内存文件读取和打印所有记录,创建一个循环。
Now, to read and print all the records from the entire Shared memory file, create a loop.
建立一个while循环从stdin中读取数据,这样可以将dots文件中的各项内容提取出来。
With a while loop set up to read from stdin, the various components of the dots file are extracted.
和读取文件的任何软件一样,解析器也是围绕着读循环(读入文件的循环)创建的。
Like any software reading a file, the parser is built around a reading loop: a loop that progresses through the file.
但是,一般情况下,把这些主机名放在一个文本文件中并使用while循环读取它们。
(Generally, though, you would have these hosts in a text file and read them in using a while loop.)
回想一下 /etc/shadow.dynamics文件的格式为 “usernamesaltpassword”,while 循环将把该文件的所有行读取到 g_user_dynamics 数据结构中。
Recall that the format of the /etc/shadow.dynamics file is "username salt password," which the while loop reads each line of the file into the g_user_dynamics data structure.
如何读取多个文件在一个循环?
交换通道可以循环读取文件对象中的行。这是内存操作的效率,快速,代码简单。
An alternate approach to reading lines is to loop over the file object. This is memory efficient, fast, and leads to simpler code.
交换通道可以循环读取文件对象中的行。这是内存操作的效率,快速,代码简单。
An alternate approach to reading lines is to loop over the file object. This is memory efficient, fast, and leads to simpler code.
应用推荐