目录和文件的区别 [英] directory and file difference

查看:143
本文介绍了目录和文件的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目录和文件.
目录和文件有什么区别? ;
目录做什么? ;
为什么使用目录? ;
是什么使目录类特别? ;
还有什么其他方法可以在不使用目录类的情况下进行操作? ;
目录的功能是什么? ;

Directory & file.
what is the difference between directory and file? ;
what does directory do? ;
why do we use directory? ;
what makes directory class special? ;
is there any other way to do what directory class does without using it? ;
what are abilities of directory? ;

推荐答案

目录和文件对象不同,因为它们描述的目标不同.目录是指包含文件集合的磁盘目录(或类似目录).

如果愿意,可以将目录视为一种特殊的文件类型,它告诉您获取每个文件的位置.在很多方面都是错误的,但是它可以帮助您更好地考虑结构.

因此,Directory对象执行与目录相关的事情,例如列出其中的文件,而File对象执行与文件相关的事情,例如列出文件的属性,大小等.

有关更多详细信息,请参见目录类 [文件类 [
The Directory and File objects are different because the targets they describe are different. A Directory refers to a disk directory (or similar) which contains a collection of Files.

If you like, think of a Directory as a special type of file which tells you where to go to get to each file. It''s wrong in many ways, but it may help you to think about the structures a little better.

So a Directory object does directory related things, like listing the files in it, while a File object does file related things, like listing the file attributes, the size, and so forth.

For more detail, see the Directory class[^] and File class[^], both on MSDN


这篇关于目录和文件的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆