Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5226975
  • 博文数量: 1696
  • 博客积分: 10870
  • 博客等级: 上将
  • 技术积分: 18357
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 15:16
文章分类
文章存档

2017年(1)

2016年(1)

2015年(1)

2013年(1)

2012年(43)

2011年(17)

2010年(828)

2009年(568)

2008年(185)

2007年(51)

分类: LINUX

2007-10-22 17:01:49

Filenames in Unix


Unix is rather flexible regarding file names. A valid Unix filename can contain any character other than "/". Most systems allow filenames of up to 256 characters in length. The filenames motd, motd.new and motd.backup are all valid in Unix. You could also have filenames like motd_new.backup. Unix does not attach any special significance to characters like "." or "_" in filenames; they are treated just like any other character. However, use of these characters can make filenames more meaningful to users.

Many compilers and other Unix programs do impose some restrictions on filenames. For instance, the C++ compiler expects that filenames for your programs should end in .h or .cpp. Thus Lab1.foo is not a valid name for a RESOLVE/C++ main program file, but Lab1.cpp is.

The same rules that apply to filenames also apply to directory names.

Important Note: The Unix system treats a directory as a special kind of file whose contents are the list of files and subdirectories within it. As a result, you'll notice that many of the rules that apply to files also apply to directories.

阅读(4410) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~