Append additional data to the file object.
在文件对象中附加上其他数据。
Another familiar line is the instantiation of the File object.
另一个类似行是File对象的实例化。
To write data to a file, you have to first create the file object.
要把数据写入文件,必须先创建file对象。
A very simplified view of the file object is provided in Figure 6.
图6提供了文件对象的简化视图。
The file object refers to a dentry object, which refers to an inode.
file对象引用dentry对象,后者引用inode。
The first parameter is the POJO. The second parameter is the File object.
第一个参数是POJO,第二个参数是File对象。
Now, notice the last line in Listing 1, which calls a close method on the file object.
现在,请注意清单1中的最后一行,它调用file对象的close方法。
The file object is the basic mechanism by which you interact with files on your computer.
file是与计算机上的文件进行交互的基本机制。
If you need to append data to a file, you should use the append mode when creating the file object.
如果需要向文件中添加数据,应当在创建file对象时,使用添加模式。
The solution to this problem is also easy: Tell the file object to go back to the beginning of the file.
这个问题的解决方案也很简单:让file对象返回文件的开头。
The simplest technique for learning more about the file object is to ask for help, as shown in Listing 2.
学习file对象的最简单方法就是阅读帮助,如清单 2 所示。
As shown in Listing 6, however, writing is easy once you know the basics of working with the file object.
但是如清单6所示,一旦了解了使用file对象的基础知识,写入也很容易。
You can easily do so in Python by appending 'b' to the file mode when you create the file object, as shown in Listing 7.
在创建file对象时,通过把'b'添加到文件模式中,可以很容易地用 Python 处理二进制数据,如清单7 所示。
The read method takes two parameters: the class of the POJO and the file object that represents the XML file containing the data.
read方法有两个参数:POJO的类和File对象,后者代表包含数据的XML文件。
This section explores the superblock, the index node (or inode), the directory entry (or dentry), and finally, the file object.
这个小节探索了超块(superblock)、索引节点(或inode)、目录条目(或dentry)和文件对象。
You can use the file object to read data, to write data, to append data to a file, and to work with either binary or textual data.
可以用file对象读取数据、写入数据或把数据添加到文件,以及处理二进制或文本数据。
An alternate approach to reading lines is to loop over the file object. This is memory efficient, fast, and leads to simpler code.
交换通道可以循环读取文件对象中的行。这是内存操作的效率,快速,代码简单。
An alternative approach to reading lines is to loop over the file object. This is memory efficient, fast, and leads to simpler code.
一种替代的方法是通过遍历文件对象来读取文件行。这是一种内存高效、快速,并且代码简介的方式。
The second for loop simplifies this process a little by using an implicit variable (that is, one that isn't explicitly created) for the file object.
第二个for循环通过使用file对象的隐式变量(也就是说,变量不是显式创建的),对这个过程稍做了点儿简化。
You then use a modified print statement — with two greater-than symbols followed by the variable holding the file object — to write the same strings.
然后使用修改过的print语句——两个大于号后边跟着容纳file对象的变量——写入相同的string。
You may notice that the file name of the transferred file can be obtained and, in this case, the file name is used when instantiating the file object.
您可能会注意到可以得到传输的文件的名称,在这个示例中,在实例化File对象时使用到了文件名称。
The next two lines of code-use generator expressions to handle the file object ps.stdout and to parse it and search it for the lines you are looking for.
接下来的两行代码使用生成器表达式来处理文件对象ps .stdout,分析该文件并在其中搜索您正在查找的行。
Inside the _setstate_ method we are able to recreate the file object based on the name and position information we pickled, and assign the file object to the instance's logfile attribute.
在_ setstate _方法内,可以根据经过pickle的名称和位置信息来重建文件对象,并将该文件对象分配给这个实例的logfile属性。
A CU typically represents the text and data contributed to an executable by a single relocatable object file.
CU通常表示由单个可重新定位的对象文件带来可执行文件的文本和数据。
Even the smallest metallic object, whether a nail file or cigarette lighter, is immediately confiscated.
即便是最小的金属物品,不论是指甲锉刀还是打火机,都会立刻被没收。
If there is an existing library file, the object files are added to it.
如果存在一个现有的库文件,那么将目标文件添加到其中。
The extract file shows the repository object where the extraction information is contained.
该提取文件显示包含提取信息的储存库对象。
If the object files change, the probe object file must be regenerated or the linking will fail.
如果对象文件改变了,必须重新生成探测对象文件,否则链接会失败。
The remaining object from the second file is retrieved on the next poll cycle.
第二个文件中的剩余对象将在下一个轮询周期中进行检索。
The probe object file you generate, and the object files on which it was based, must match.
生成的探测对象文件与它基于的对象文件必须匹配。
应用推荐