苯磺酸氨氯地平片什么时候吃| 肾盂肾炎吃什么药好| 自主意识是什么意思| 开塞露有什么功效| 嘴唇发紫是什么原因引起的| 蒋字五行属什么| 吃什么可以降低尿酸| mra检查是什么意思| 什么牙膏好| 医保报销是什么意思| 耵聍是什么意思| 谷维素片是治什么病的| 抗体阳性说明什么| 阴囊潮湿吃什么药好| 两票制指的是什么| 心电图逆钟向转位什么意思| 开黑是什么意思| sid是什么意思| 心脏不舒服做什么检查| 幽门螺旋杆菌感染有什么症状| 一什么木屋| 休学需要什么条件| 汆水是什么意思| 游泳前一定要做好什么运动| 贝母和川贝有什么区别| 牙齿疼是什么原因| 别开生面是什么意思| 风是什么结构| 士官是什么级别| 进产房吃什么补充体力| 兜兜转转是什么意思| 导滞是什么意思| 指甲硬是什么原因| 孕妇血糖高吃什么| 脸皮最厚是什么生肖| 头发的主要成分是什么| 肉桂有什么作用| 脸部肌肉跳动是什么原因| 什么是比例| 胎盘厚度代表什么| 6月17日是什么星座| ser是什么氨基酸| 骶髂关节炎吃什么药| 心境什么意思| ige是什么意思| 坚信的意思是什么| 秀女是什么意思| 美国为什么支持以色列| 大便粘马桶吃什么药| 病历是什么| 酸梅汤不能和什么一起吃| 头抖是什么原因| e代表什么数字| 荨麻疹涂什么药| 肌红蛋白高说明什么| 阴道口长什么样| 四大洋分别是什么| 按摩是什么意思| 抛光是什么意思| 肚子胀气吃什么药好得快| 天生一对是什么意思| 什么书买不到| 突然头晕眼花站不稳是什么原因| 孔雀翎是什么东西| 咳嗽看什么科室| 卵巢无回声是什么意思| 行尸走肉什么意思| 自私自利是什么意思| 孕妇吃什么水果好对胎儿好| 男人都喜欢什么样的女人| 鹅喜欢吃什么草| 什么叫肛瘘| 囊肿挂什么科| 梦见大水是什么意思| 人参和什么泡酒能壮阳| bcm是什么意思| 阑尾炎是什么病| 延时吃什么药| 什么是甲状腺结节| 后羿射日什么意思| 什么时候开始孕吐| 爆血管是什么原因引起的| 山梨糖醇是什么| 经常扁桃体发炎是什么原因| 肛门瘙痒看什么科| 刘备字什么| 保胎吃什么食物好| 小便无力是什么原因| 蟾蜍属于什么动物| 打马赛克是什么意思| 什么贵人能治孤辰寡宿| 试管什么方案好| 出水痘能吃什么食物| 心虚吃什么补最快| 帕金森是什么引起的| 庚辰五行属什么| 偷什么东西不犯法| 过敏性紫癜挂什么科| 便秘用什么药好| 素鲍鱼是什么做的| 哺乳期不能吃什么| 排卵期后面是什么期| 头总出汗是什么原因| 76年出生属什么生肖| alan英文名什么意思| 卵泡生成素高是什么原因| 拉垮什么意思| 唐氏儿是什么意思| 跟腱断裂是什么感觉| 偶发性房性早搏是什么意思| 年柱金舆是什么意思| 什么名字最好听| 梦见狗咬人是什么预兆| 槐花什么时候开花| 三七粉不适合什么人吃| 隔三差五是什么意思| 五月十五是什么星座| 念珠菌和霉菌有什么区别| 蜻蜓吃什么| 小脑梗塞会出现什么症状| 猫条是什么| 传导阻滞吃什么药| 心机是什么意思| 胃发热是什么原因| 梦见大蛇是什么意思| 伶字五行属什么| 中药什么时间喝效果最好| 麦粒肿滴什么眼药水| 什么的地板| 舌头干涩是什么病前兆| 辣乎乎的什么| lcr是什么意思| usim卡是什么卡| 散瞳快散和慢散有什么区别| hla医学上是什么意思| 狠人是什么意思| 什么是二级医院| 吃什么清理脑血管堵塞| 月经不调去医院挂什么科| 那是什么| cp什么意思网络用语| 美国为什么不敢动朝鲜| 拿乔是什么意思| 肝损害是什么意思| 辣椒炭疽病用什么药| 阴道骚痒是什么原因| 主见是什么意思| 洋葱吃了有什么好处| 老夫老妻什么意思| 姓彭的女孩子取什么名字好| 时柱代表什么| 心脑血管供血不足吃什么药| 什么叫溶血| faleda是什么牌子的手表| 悦己是什么意思| 月经9天了还没干净是什么原因| gypsophila什么意思| 火牙是什么原因引起的| moco是什么牌子| 感叹号像什么| 生物医学工程专业学什么| 宫颈管短有什么症状| 去火吃什么| cph是什么意思| 眼睛流眼泪用什么眼药水| 多发性结节是什么意思| 脸黄是什么原因造成的| 乳糖酶是什么| 颈椎引起的头晕是什么症状| 7月6日是什么节日| 什么的雄鸡| 1比1是什么意思| 手疼挂什么科| 非典型细胞是什么意思| 鬼压床是什么原因| 脾虚痰湿吃什么中成药| 消谷善饥是什么意思| 状元是什么官| 气血不足吃什么| 小燕子吃什么| 冻梨是什么梨| 管型尿是什么意思| 女性更年期吃什么药| 藠头是什么菜| 吃什么可以补黑色素| 血管为什么会堵塞| 湿疹长什么样子图片| tct是什么检查| 5月20是什么星座| 梦见家被偷了什么预兆| 无产阶级是什么意思| 植物神经功能紊乱吃什么药| 西安和咸阳什么关系| 腰酸痛挂什么科| 欲盖弥彰是什么意思| 只是女人容易一往情深是什么歌| 吃什么可以缓解焦虑| 男人小腹疼痛是什么原因| 什么不止| 海带和什么菜搭配好吃| 拔了智齿需要注意什么| 转的第四笔是什么| 蛔虫是什么| 色令智昏是什么意思| 台湾高山茶属于什么茶| 村书记是什么级别| 怀孕第一个月有什么症状| 大暑是什么意思啊| 渗透率是什么意思| 甘草片不能和什么药一起吃| 脊背疼是什么原因| phd是什么| 竹荪是什么东西| 孟力念什么| 美女的阴暗是什么样的| 虹膜是什么意思| 心律不齐吃什么药最快| 毕业送老师什么礼物好| 1987是什么年| 长残了是什么意思| 为什么会得子宫肌瘤| 杨的右边念什么| 盐吃多了有什么危害| 小翅膀车标是什么车| 摩尔是什么| dwi呈高信号什么意思| 990金是什么金| CA是什么激素| 蔗糖素是什么| 鸟字旁的字和什么有关| 凝血酶时间是什么意思| 芥酸对身体有什么危害| 相依相偎是什么意思| 苏慧伦为什么不老| 菩提是什么材质| 真丝姆米是什么意思| 尿尿疼是什么原因| 半夜是什么生肖| 托帕石是什么| 流萤是什么意思| 行为艺术是什么意思| 浅表性胃炎伴糜烂吃什么药效果好| 脸上黑色的小点是什么| 胸膜炎什么症状| 缘字五行属什么| 葛根粉是什么| 肌酐高可以吃什么水果| 青什么黄什么| 打嗝吃什么药效果好| 3月25号是什么星座| 中将是什么级别| 身上无力是什么原因| 拔罐有什么好处| 胸痛一阵一阵的痛什么原因| 右肺疼是什么原因| 肾脏炎有什么症状| 八个月宝宝可以吃什么水果| 投桃报李是什么生肖| 龙胆泻肝丸治什么病| 买手是什么意思| 困惑是什么意思| 小蓝瓶是什么| 心慌是什么感觉| 什么药对伤口愈合快| 百度

“中国网事感动2017”年度网络人物颁奖典礼举行

百度 虽然C罗仍旧处在巅峰状态,但是很多中国球迷都希望在中超的赛场上看到C罗,这也将极大提升中超联赛的影响力。

A path (or filepath, file path, pathname, or similar) is a text string that uniquely specifies an item in a hierarchical file system. Generally, a path is composed of directory names, special directory specifiers and optionally a filename, separated by delimiting text. The delimiter varies by operating system and in theory can be anything, but popular, modern systems use slash /, backslash \, or colon :.

A path can be either relative or absolute. A relative path includes information that is relative to a particular directory whereas an absolute path indicates a location relative to the system root directory, and therefore, does not depends on context like a relative path does. Often, a relative path is relative to the working directory. For example, in command ls f, f is a relative path to the file with that name in the working directory.

Paths are used extensively in computer science to represent the directory/file relationships common in modern operating systems and are essential in the construction of uniform resource locators (URLs).

History

edit

Multics first introduced a hierarchical file system with directories (separated by ">") in the mid-1960s.[1]

Around 1970, Unix introduced the slash character ("/") as its directory separator.

Originally, MS-DOS did not support directories, but when adding the feature, using the Unix standard of slash was not a good option since many existing commands used slash as the switch prefix. For example, dir /w. In contrast, Unix uses dash - as the switch prefix. In this context, MS-DOS version 2.0 used backslash \ for the path delimiter since it is similar to slash but did not conflict with existing commands. This convention continued into Windows in its shell Command Prompt. Eventually, PowerShell, was introduced to Windows that is slash-agnostic, allowing the use of either slash in a path.[2][3]

Path syntax

edit

The following table describes the syntax of paths in notable operating systems and with notable aspects by shell.

Context Root
dir
Path
delim
Working
dir
Parent
dir
Home
dir
Examples
Unix / / . .. ~ /home/user/docs/Letter.txt
./inthisdir
../../greatgrandparent
~/.rcinfo
DOS COMMAND.COM [drive letter:]\
or \\[server name]\[volume]\
\ . .. C:\USER\DOCS\LETTER.TXT
A:PICTURE.JPG
\\SERVER01\USER\DOCS\LETTER.TXT
OS/2 cmd.exe [drive letter:]\
or \\[server name]\[volume]\
/
or
\
. .. C:\user\docs\Letter.txt
A:Picture.jpg
\\SERVER01\USER\docs\Letter.txt
Windows Command Prompt \ (relative to current working directory root)
or [drive_letter]:\
or \\[server]\[sharename]\
or \\?\[drive_spec]:\
or \\?\UNC\[server]\[sharename]\
or \\.\[physical_device]\[4]
/
or
\
. ..[5] C:\user\docs\Letter.txt
/user/docs/Letter.txt
C:\Letter.txt
\\Server01\user\docs\Letter.txt
\\?\UNC\Server01\user\docs\Letter.txt
\\?\C:\user\docs\Letter.txt
C:\user\docs\somefile.ext:alternate stream name
./inthisdir
../../greatgrandparent
Windows PowerShell [drive letter:]/
or [drive name:]\
or \\[server name]\
or [PSSnapIn name]\[PSProvider name:][:PSDrive root]
/
or
\
. .. ~ C:\user\docs\Letter.txt
C:\user/docs\Letter.txt
\\Server01\user\docs\Letter.txt
cd ~\Desktop

UserDocs:/Letter.txt
Variable:PSVersionTable
Registry::HKEY_LOCAL_MACHINE\SOFTWARE\
Microsoft.PowerShell.Security\Certificate::CurrentUser\

TOPS-20 DCL [device name:] . PS:<USER.DOCS>LETTER.TXT,4
RSX-11 MCR [device name:] DR0:[30,12]LETTER.TXT;4
OpenVMS DCL [device name:][000000]
or [NODE["accountname password"]]::[device name][000000]:
. [] [-] SYS$LOGIN: SYS$SYSDEVICE:[USER.DOCS]PHOTO.JPG

[]IN_THIS_DIR.COM;
[-.-]GreatGrandParent.TXT
SYS$SYSDEVICE:[.DRAFTS]LETTER.TXT;4
GEIN::[000000]LETTER.TXT;4
SYS$LOGIN:LOGIN.COM

Classic
Mac OS
[volume or drive name]: : : :: Macintosh HD:Documents:Letter
:fileincurrentdir
::fileinparent
:::fileingrandparent
ProDOS AppleSoft BASIC /[volume or drive name]/ / /SCHOOL.DISK/APPLEWORKS/MY.REPORT

FLIGHT.SIMULATOR,D2

AmigaOS Amiga CLI /
AmigaShell
[drive, volume, device, or assign name]: / empty
string
/ Workbench:Utilities/MultiView
DF0:S/Startup-Sequence
S:Startup-Sequence
TCP:en.wikipedia.com/80
RISC OS ShellCLI [fs type[#option]:][:drive number or disc name.]$

note: &, %, and @ can also be used to reference the root
of the current user, the library and the current (working) directory respectively.

. @ ^ & ADFS::MyDrive.$.Documents.Letter
Net#MainServer::DataDrive.$.Main.sy10823
LanMan::WindowsC.$.Pictures.Japan/gif
NFS:&.!Choices
ADFS:%.IfThere
@.inthisdir
^.^.greatgrandparent

When filesystems with filename extensions are mounted,
'.' characters are changed to '/', as in the Japan/gif example above.

Symbian OS File manager \ \ \user\docs\Letter.txt
Domain/OS Shell

// (root of domain)
/ (root of current node)

/ . \ ~ //node/home/user/docs/Letter.txt
./inthisdir
\\greatgrandparent
~rcinfo
MenuetOS CMD / /
Stratus VOS VOS command-line
interpreter
%[system_name]#[module_name]> > < %sysname#module1>SubDir>AnotherDir
NonStop
Kernel
TACL
Tandem Advanced
Command Language
No root . none \NODE.$DISK.SUBVOL.FILE
\NODE.$DEVICE
\NODE.$DEVICE.#SUBDEV.QUALIFIER
CP/M CCP [drive letter:] no directory support, just user areas 0–F A:LETTER.TXT
GS/OS :[volume name]: or .[device name]: or [prefix]:

note: prefix may be a number (0–31), * (boot volume) or @ (AppleShare home directory)

:
or
/
@ :Apps:Platinum.Paint:Platinum.Paint
*:System:Finder
.APPLEDISK3.5B/file
OpenHarmony (incl. HarmonyOS) exec[6][7] hb set -root [ROOT_PATH]

hb set -p --product [PRODUCT_NAME]

> ./ ../ LOCAL>MEDIA_TYPE_>Download>Letter.txt

Japanese and Korean versions of Windows often display the '' character or the '?' character instead of the directory separator. In such cases the code for a backslash is being drawn as these characters. Very early versions of MS-DOS replaced the backslash with these glyphs on the display to make it possible to display them by programs that only understood 7-bit ASCII (other characters such as the square brackets were replaced as well, see ISO 646, Windows Codepage 932 (Japanese Shift JIS), and Codepage 949 (Korean)). Although even the first version of Windows supported the 8-bit ISO-8859-1 character set which has the Yen sign at U+00A5, and modern versions of Windows supports Unicode which has the Won sign at U+20A9, much software will continue to display backslashes found in ASCII files this way to preserve backward compatibility.[8]

macOS, as a derivative of UNIX, uses UNIX paths internally. However, to preserve compatibility for software and familiarity for users, many portions of the GUI switch "/" typed by the user to ":" internally, and switch them back when displaying filenames (a ":" entered by the user is also changed into "/" but the inverse translation does not happen).

Paths in programming languages

edit

Programming languages also use paths. E.g.: When a file is opened. Most programming languages use the path representation of the underlying operating system:

 uxFile = fopen("project/readme.txt", "r")
 winFile = fopen("C:\\Program Files\\bin\\config.bat", "r")

This direct access to the operating system paths can hinder the portability of programs. To support portable programs Java uses File.separator to distinguish between / and \ separated paths. Seed7 has a different approach for the path representation. In Seed7 all paths use the Unix path convention, independent of the operating system. Under windows a mapping takes place (e.g.: The path /c/users is mapped to c:\users).

Universal Naming Convention

edit

The Microsoft universal naming convention (UNC), a.k.a. uniform naming convention, a.k.a. network path, specifies a syntax to describe the location of a network resource, such as a shared file, directory, or printer. A UNC path has the general form:

\\ComputerName\SharedFolder\Resource

Some Windows interfaces allow or require UNC syntax for WebDAV share access, rather than a URL. The UNC syntax is extended[9] with optional components to denote use of SSL and TCP/IP port number, a WebDAV URL of http[s]://HostName[:Port]/SharedFolder/Resource becomes

\\HostName[@SSL][@Port]\SharedFolder\Resource

When viewed remotely, the "SharedFolder" may have a name different from what a program on the server sees when opening "\SharedFolder". Instead, the SharedFolder name consists of an arbitrary name assigned to the folder when defining its "sharing".

Some Windows interfaces also accept the "Long UNC":

\\?\UNC\ComputerName\SharedFolder\Resource

Windows uses the following types of paths:

  • local file system (LFS), such as C:\File
  • universal naming convention (UNC), such as \\Server\Volume\File or /<internet resource name>[\Directory name] (at least in Windows 7 and later)
  • "long" device path such as \\?\C:\File or \\?\UNC\Server\Volume\File.[10] This path points to the local file namespace and \\.\ is a similar one that points to the local DOS device namespace. This format is also the "raw" or "uninterpreted" path, since it sends paths straight to the file system without converting / to \ and interpreting names like ...[4]
  • Windows NT object manager \\??\-prefixed paths (global DOS namespace).[11][12]

In versions of Windows prior to Windows XP, only the APIs that accept "long" device paths could accept more than 260 characters.

The shell in Windows XP and Windows Vista, explorer.exe, allows path names up to 248 characters long.[citation needed]

Since UNCs start with two backslashes, and the backslash is also used for string escaping and in regular expressions, this can result in extreme cases of leaning toothpick syndrome: an escaped string for a regular expression matching a UNC begins with 8 backslashes – \\\\\\\\ – because the string and regular expression both require escaping. This can be simplified by using raw strings, as in C#'s @"\\\\" or Python's r'\\\\', or regular expression literals, as in Perl's qr{\\\\}.

POSIX pathname definition

edit

Most Unix-like systems use a similar syntax.[13] POSIX allows treating a path beginning with two slashes in an implementation-defined manner,[14] though in other cases systems must treat multiple slashes as single slashes.[15] Many applications on Unix-like systems (for example, scp, rcp, and rsync) use resource definitions such as:

hostname:/directorypath/resource

or URI schemes with the service name (here 'smb'):

smb://hostname/directorypath/resource

Examples

edit

Unix

edit

The following examples are for typical, Unix-based file systems:

Given the working directory is /home/mark/ and it contains subdirectory bobapples, relative paths to the subdirectory include ./bobapples and bobapples, and the absolute path is /home/mark/bobapples. A command to change the working directory to the subdirectory:

$ cd bobapples

If the working directory was /home/jo, then the relative path ../mark/bobapples specifies the subdirectory. The double dots .. indicates a move up the directory hierarchy one level to /home, the rest indicates moving down to mark and then boapples.

Microsoft shells

edit
 
Screenshot of a Windows Command Prompt shell showing filenames in a directory

The Windows API accepts slash for path delimiter.

Unlike Unix that always has a single root directory, a Windows file system has a root for each storage drive. An absolute path includes a drive letter or uses the UNC format.

A UNC path (starting with \\?\) does not support slashes.[4]

A:\Temp\File.txt is an absolute path that specifies a file named File.txt in the directory Temp which is in the root of drive A::

C:..\File.txt is a relative path that specifies file File.txt located in the parent of the working directory on drive C::

Folder\SubFolder\File.txt is a relative path that specifies file File.txt in directory SubFolder which is in directory Folder which is in the working directory of the current drive:

File.txt is a relative path that specifies File.txt in the working directory:

\\.\COM1 specifies the first serial port, COM1:

The following uses a path with slashes for directory delimiter:

C:\>more < C:/Windows/system.ini
; for 16-bit app support
[386Enh]
woafont=dosapp.fon
EGA80WOA.FON=EGA80WOA.FON
EGA40WOA.FON=EGA40WOA.FON
CGA80WOA.FON=CGA80WOA.FON
CGA40WOA.FON=CGA40WOA.FON
...

A path with forward slashes may need to be surrounded by double quotes to disambiguate from command-line switches. For example, dir /windows is invalid, but dir "/window" is valid. And cd is more lenient by allowing cd /windows.

See also

edit
  • basename – Shell command for extracting the last name from a path
  • Device file – Interface to a device driver that appears in a file system as if it were an ordinary file
  • dirname – Shell command in Unix systems
  • Distributed file system – Type of decentralized filesystem
  • Filename – Text string used to uniquely identify a computer file
  • Filesystem Hierarchy Standard – Linux standard for directory structure
  • Fully qualified file name – Unambiguous name in computer code
  • PATH (variable) – Computer environment variable
  • URL – Web address to a particular file or page

References

edit
  1. ^ Daley, R.C.; Neumann, P.G. (1965). "A general-purpose file system for secondary storage". Proceedings of the November 30--December 1, 1965, fall joint computer conference, Part I on XX - AFIPS '65 (Fall, part I). Vol. Part I. pp. 213–229. doi:10.1145/1463891.1463915. S2CID 16236414.
  2. ^ "Why Windows Uses Backslashes and Everything else Uses Forward Slashes". 10 February 2014.
  3. ^ "Why is the DOS path character ""?". 24 June 2005.
  4. ^ a b c "Naming Files, Paths, and Namespaces". Microsoft Docs. 15 December 2022.
  5. ^ "cd". Windows Commands: Windows Server. Microsoft Docs. 3 February 2023. Retrieved 4 October 2023.
  6. ^ "Introduction to the Shell". GitHub. OpenAtom OpenHarmony. Retrieved 13 March 2024.
  7. ^ "exec". GitHub. OpenAtom OpenHarmony. Retrieved 14 March 2024.
  8. ^ "When is a backslash not a backslash?". Sorting it all Out.
  9. ^ "DavGetHTTPFromUNCPath function". WebDAV: Windows. Microsoft Docs. series. 13 October 2021. Retrieved 4 October 2023.
  10. ^ "File path formats on Windows systems". File and Stream I/O: .NET. Microsoft Docs. Retrieved 14 July 2019.
  11. ^ "winapi - Is there a difference between \??\ and \\?\ paths?". Stack Overflow.
  12. ^ "Path prefixes \??\ and \\?\". Stack Overflow.
  13. ^ "UNC Definition". ComputerLanguage.com.
  14. ^ "POSIX pathname resolution specification".
  15. ^ "POSIX pathname definition".
edit
孕吐最早什么时候开始 吃什么代谢快有助于减肥 不完全性右束支阻滞是什么意思 胎盘位于子宫后壁是什么意思 梦见自己又结婚了是什么意思
淳朴是什么意思 口腔溃疡一直不好是什么原因 纠结是什么意思 大姨妈血块多是什么原因 商鞅姓什么
核磁共振什么时候出结果 二尖瓣反流什么意思 1969年是什么年 唵嘛呢叭咪吽什么意思 洗牙有什么危害吗
甲醛超标有什么危害 右胸上部隐痛什么原因 开荤是什么意思 cv是什么 语五行属什么
不饱和脂肪酸是什么意思96micro.com 点卯是什么意思hcv8jop2ns0r.cn 为什么总是头晕hcv7jop6ns8r.cn 枫叶的花语是什么hcv7jop7ns3r.cn 吃什么解油腻hcv9jop3ns3r.cn
姹紫嫣红是什么意思hcv9jop4ns4r.cn 复视是什么意思hcv7jop7ns0r.cn 脆鱼是什么鱼hcv9jop3ns0r.cn 什么是轻断食hcv9jop1ns6r.cn 毒瘾发作是什么感觉hcv7jop9ns8r.cn
左室舒张功能减退是什么意思aiwuzhiyu.com 为什么会无缘无故长痣hcv8jop1ns4r.cn 面皮是什么做的naasee.com cnb是什么意思hcv9jop3ns5r.cn 一毛不拔是什么动物hcv8jop5ns0r.cn
精液长什么样hcv9jop1ns8r.cn 甲胎蛋白是什么意思hcv8jop7ns3r.cn 正念是什么hcv7jop9ns0r.cn 土字旁的字与什么有关onlinewuye.com 家里出现蛇是什么征兆hcv8jop8ns4r.cn
百度