The file object refers to a dentry object, which refers to an inode.
file对象引用dentry对象,后者引用inode。
In Listing 3, you instantiated a file object for a file that didn't exist.
在清单3中,是为一个不存在的文件实例化了File对象。
Now, notice the last line in Listing 1, which calls a close method on the file object.
现在,请注意清单1中的最后一行,它调用file对象的close方法。
First, it creates a file object from the build file and then creates a new Project object.
首先,它从构建文件创建一个文件对象,然后创建一个新的Project对象。
Next, you instantiate a File object with the name of the file that will be the XML document.
再接下来,实例化一个File对象,它的名称是将成为XML文档的那个文件的名称。
At the top is the open file object, which is referenced by a process's file descriptor list.
在顶层是打开的file对象,它由进程的文件描述符列表引用。
The file object is the basic mechanism by which you interact with files on your computer.
file是与计算机上的文件进行交互的基本机制。
Don't like the working directory? Call directory with a new working directory as a File object.
如果希望使用新的工作目录,可以调用directory并提供新的工作目录作为File对象。
Create an instance of File Object that points to the WebContent folder of the portlet project.
创建文件对象的一个实例,该对象指向portlet项目的WebContent文件夹。
If you need to append data to a file, you should use the append mode when creating the file object.
如果需要向文件中添加数据,应当在创建file对象时,使用添加模式。
Overall, the process is simple: Create an appropriate file object, then read or write as necessary.
总体来说,过程很简单:创建合适的file对象,然后按照需要读取和写入。
Here, we create a new Persistent: : file object whose contents will be stored in the file variables.txt.
我们在这里创建了新的Persistent:File对象,其内容将存储在文件variables . txt中。
A text file object can use the API to get the content object (content.xml) and style object (styles.xml).
文本文件对象可以使用API来获取内容对象(content . xml)和样式对象(styles . xml)。
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对象的基础知识,写入也很容易。
It is not a problem to have both spool file object sets, and IFS stream file object sets in the same collection.
一个collection中可以同时拥有spool文件对象集和ifs流文件对象集。
You create a file object using the file constructor or the open method, which is an alias for the file constructor.
用file构造函数或open方法创建file对象,open是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 next line creates a file object, passing in the name "testit.txt" and a 'w' character (to let you write to the file).
接下来的一行创建file对象,传递进名称“testit . txt ”和'w '字符(写入文件)。
In this example, you create an appropriate file object, then write the binary characters with ASCII values from 50 to 69.
在这个示例中,创建一个合适的file对象,然后用从50到69的ascii值写入二进制字符。
This section explores the superblock, the index node (or inode), the directory entry (or dentry), and finally, the file object.
这个小节探索了超块(superblock)、索引节点(或inode)、目录条目(或dentry)和文件对象。
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文件。
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对象读取数据、写入数据或把数据添加到文件,以及处理二进制或文本数据。
In this case, you create an implicit file object, and Python does the rest, allowing you to iterate over all the lines in the file.
在这个示例中,创建隐式file对象,然后Python做余下的工作,允许对文件中的全部行进行迭代。
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 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,分析该文件并在其中搜索您正在查找的行。
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。
应用推荐