⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 symlinks.txt

📁 操作系统文件管理
💻 TXT
字号:
							1999-09-12							Emil Brink			Symbolic Links in gentoo1. INTRODUCTIONThis little document introduces the support for symbolic links thatwas introduced in version 0.11.7 of gentoo. This support replacesthe old one that was removed as of version 0.11.1. Sorry about thedelay. :)2. WHAT IS A SYMBOLIC LINK?A symbolic link, also known as a soft link or symlink, is a specialfile that contains a pathname of some other file. Whenever the linkis accessed by the filesystem, it will use the contained pathnameinstead, thus "following the link". Note that the contents of asymlink need not be the pathname of an existing file; you can usesymlinks to store arbitrary data. At least on Linux systems, themaximum length of the contents part of a symlink seems to be 1023bytes.	In the shell, you can create symbolic links by usingthe "ln" (for link) command, with the option "-s" (for symbolic).For more information, see the man page for ln(1).3. SYMLINKS IN gentooSymbolic links are treated *transparently* by gentoo wheneverpossible. This means that gentoo will treat the link as its dest-ination, rather than as a link. Since referencing other files iswhat symlinks are for, I think it's reasonable to treat them asif they were in fact the files they're pointing at. This isconsistent with the way standard shell commands (cd, ls) treatsymlinks.	This transparency includes gentoo's typing and stylingsystem: a symbolic link to e.g. a PNG image will use the typeand style defined for PNG images, and will respond accordingly whendouble clicked on. It also includes sorting: links to directorieswill sort together with the directories.	However, the transparancy is only partial. The informationshown in a dirpane row for a symbolic link includes mostly dataabout the link itself, not its destination. This means that thingslike size, protection flags, and dates all refer to the link itself.The only column that shows information about the link target isthe Icon column (if present).	This partial transparancy means that in a listing, you willbe able to spot the links from the regular files quite easily:	First, if you enable type characters for the Name columnof the panes, the links will have "@" symbols appended to theirnames.	Second, if you enable link destination display (also forthe Name column), links will display an arrow ("->") plus the nameof the link target. So, if you enable both of these features, asymbolic link called "image" to a PNG file called "picture.png"will display as "image@ -> picture.png".	Third, the protection flags for a symbolic link will havethe letter 'l' (for link, of course) in the leftmost position.4. WORKING WITH SYMLINKSOf course, gentoo could not be said to really support symlinks ifthey could only be used "passively". So, gentoo includes a set ofbuiltin commands to actively work with symbolic links.4.1 SymLinkThe SymLink command works much like the Copy command. For eachselected source file, it will create an absolute symbolic linkin the destination pane, pointing at the source file.4.2 SymLinkAsThis command works like the CopyAs command; for each selectedsource file, it will display a dialog asking you for a link name,and then create a symbolic link in the destination pane, with thegiven name, and pointing at the source file.4.3 SymLinkCloneContinuing the analogy, this command works like Clone. It will askfor a link name for every selected source file, and then create anabsolute link in the *source* pane. Handy when working with sharedlibraries, since those tend to use lots of links in the samedirectory.4.4 SymLinkEditThis command works in two distinctly different modes depending onthe active pane's selection when the command is run.	If there is a selection, the command will pop up a windowfor each symbolic link in the selection, allowing you to directlyedit the link destination in a text entry field. There is also abutton popping up a file selection dialog, thus letting you locatethe desired link target easily. When you click "OK", the currentlink will be modified to point at the new target.	If there is no selection, the command will pop up a dialogletting you enter both the name and the contents of a link. Whenyou click "OK" (or press RETURN), the specified link will be cre-ated. In this mode, the command is analogous to the shell command ln mentioned above. NOTE: It is possible to completely replaceordinary files and directories with symlinks -- the SymLinkEditcommand will require you to confirm any such operation.5. OTHER COMMANDSThis section contains some information about how other commandsin gentoo deal with symlinks. It is far from complete.5.1 InformationThe Information command has been extended to also show the contentsof symbolic links. The other information it displays (location, sizeet cetera) is for the link itself, not its destination. This isin keeping with the dirpanes, and seems logical to me. A futureversion of gentoo may extend the Information command to maybe showboth link and target data in the same window...5.2 Copy and MoveBoth the Copy and the Move commands will _not_ operate transparantlyon symlinks: they will copy (or move) the link itself, not itsdestination. There is currently no way of changing this behavior.	The reason for this is simply that I find it more useful,and also a bit more logical: when you copy or move an object, youexpect to either get one more of that object, or to move the objectto a new location. If Copy would follow the link, it would produceone more of the actual link destination, leaving the number of linksunchanged. Or something.	This behavior is different from that of common shellcommands (cp, mv). Beware.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -