An embodiment of the invention generally relates to computers. In particular, an embodiment of the invention generally relates to a symbolic link having a plurality of addresses that point to a plurality of target objects.
The development of the EDVAC computer system of 1948 is often cited as the beginning of the computer era. Since that time, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware (such as semiconductors, integrated circuits, programmable logic devices, programmable gate arrays, and circuit boards) and software, also known as computer programs.
One of the primary functions of computer programs is the selective storage, retrieval, and manipulation of information. Information in a computer is frequently stored in a hierarchical organization of directories and files. One way that computer programs access information is via symbolic links. A symbolic link is a type of file that contains a pathname to a specified file or other type of object. A pathname is a list of directories that must be followed to reach the specified file. The pathname is not restricted to directories in the current computer, but may also include identifiers of other computer systems attached via a network. When a computer program accesses the symbolic link, the file system of the computer redirects the program to the specified target object to which the symbolic link points.
Symbolic links are used for a wide variety of functions, including (but not limited to) national language support implementations, installation shields, and product media. Many of these functions may need to access different files based upon a criteria, such as a locale, environment, ccsid (coded character set identifier), or some other criteria, but there is no built-in way to accomplish such a task. As a result, either specialized application code must be written to access a different file dynamically based upon some criteria, or a symbolic link must be statically created that restricts the program to one specific file.
Without a way to access a variety of files, programs will not be able to take full advantage of the power of symbolic links.
A method, apparatus, system, and signal-bearing medium are provided that in an embodiment detect accessing of a symbolic link, retrieve a condition from an environment, extract an address from the symbolic link based on the condition, and return a target object based on the address. In this way, a symbolic link may be used to access a variety of target objects.
In an embodiment, a n-way symbolic link is created that includes multiple addresses that point to multiple target objects and conditions for choosing between the multiple target objects. When the symbolic link is accessed, a condition is retrieved from an environment, the correct address is extracted from the symbolic link based on the condition, and the corresponding target object is returned based on the address. In this way, a symbolic link may be used to access a variety of target objects.
Referring to the Drawing, wherein like numbers denote like parts throughout the several views,
The computer system 100 contains one or more general-purpose programmable central processing units (CPUs) 101A, 101B, 101C, and 101D, herein generically referred to as the processor 101. In an embodiment, the computer system 100 contains multiple processors typical of a relatively large system; however, in another embodiment the computer system 100 may alternatively be a single CPU system. Each processor 101 executes instructions stored in the main memory 102 and may include one or more levels of on-board cache.
The main memory 102 is a random-access semiconductor memory for storing data and programs. The main memory 102 is conceptually a single monolithic entity, but in other embodiments the main memory 102 is a more complex arrangement, such as a hierarchy of caches and other memory devices. For example, memory may exist in multiple levels of caches, and these caches may be further divided by function, so that one cache holds instructions while another holds non-instruction data, which is used by the processor or processors. Memory may further be distributed and associated with different CPUs or sets of CPUs, as is known in any of various so-called non-uniform memory access (NUMA) computer architectures.
The memory 102 includes an operating system 168, a program 169, a n-way symbolic link 170, objects 172, and a user environment 174. Although the operating system 168, the program 169, the n-way symbolic link 170, the objects 172, and the user environment 174 are illustrated as being contained within the memory 102 in the computer system 100, in other embodiments some or all of them may be on different computer systems and may be accessed remotely, e.g., via the network 130. The computer system 100 may use virtual addressing mechanisms that allow the programs of the computer system 100 to behave as if they only have access to a large, single storage entity instead of access to multiple, smaller storage entities. Thus, while the operating system 168, the program 169, the n-way symbolic link 170, the objects 172, and the user environment 174 are illustrated as residing in the memory 102, these elements are not necessarily all completely contained in the same storage device at the same time.
The operating system 168 includes a file system 176. In response to the program 169 accessing the n-way symbolic link 170, the file system 176 determines which of the objects 172 to return to the program 169 based on the n-way symbolic link 170 and the user environment 174. The file system 176 may further propagate the n-way symbolic link 170 with data based on instructions or commands from the program 169. In an embodiment, the file system 176 includes instructions capable of executing on the processor 101 or statements capable of being interpreted by instructions executing on the processor 101 to perform the functions as further described below with reference to
The program 169 may be any application or operating system function and may access the n-way symbolic link 170 at the direction of a user or independently. In an embodiment, the program 169 issues a command to change the current directory using the n-way symbolic link 170.
The symbolic link 170 is referred to as “n-way” because it is capable of including a plurality of addresses pointing to a plurality of target objects 172. The n-way symbolic link 170 is further described below with reference to
The user environment 174 stores information tailored to the user of the computer system 100. A different user environment 174 may exist for each user, for each category of user, or only one user environment 174 may exist for the entire computer system 100. The user environment 174 is further described below with reference to
The memory bus 103 provides a data communication path for transferring data among the processors 101, the main memory 102, and the I/O bus interface unit 105. The I/O bus interface unit 105 is further coupled to the system I/O bus 104 for transferring data to and from the various I/O units. The I/O bus interface unit 105 communicates with multiple I/O interface units 111, 112, 113, and 114, which are also known as I/O processors (IOPs) or I/O adapters (IOAs), through the system I/O bus 104. The system I/O bus 104 may be, e.g., an industry standard PCI (Peripheral Component Interconnect) bus, or any other appropriate bus technology. The I/O interface units support communication with a variety of storage and I/O devices. For example, the terminal interface unit 111 supports the attachment of one or more user terminals 121, 122, 123, and 124.
The storage interface unit 112 supports the attachment of one or more direct access storage devices (DASD) 125, 126, and 127 (which are typically rotating magnetic disk drive storage devices, although they could alternatively be other devices, including arrays of disk drives configured to appear as a single large storage device to a host). The contents of the DASD 125, 126, and 127 may be loaded from and stored to the memory 102 as needed.
The I/O and other device interface 113 provides an interface to any of various other input/output devices or devices of other types. Two such devices, the printer 128 and the fax machine 129, are shown in the exemplary embodiment of
Although the memory bus 103 is shown in
The network 130 may be any suitable network or combination of networks and may support any appropriate protocol suitable for communication of data and/or code to/from the computer system 100. In various embodiments, the network 130 may represent a storage device or a combination of storage devices, either connected directly or indirectly to the computer system 100. In an embodiment, the network 130 may support Infiniband. In another embodiment, the network 130 may support wireless communications. In another embodiment, the network 130 may support hard-wired communications, such as a telephone line or cable. In another embodiment, the network 130 may support the Ethernet IEEE (Institute of Electrical and Electronics Engineers) 802.3 specification. In another embodiment, the network 130 may be the Internet and may support IP (Internet Protocol). In another embodiment, the network 130 may be a local area network (LAN) or a wide area network (WAN). In another embodiment, the network 130 may be a hotspot service provider network. In another embodiment, the network 130 may be an intranet. In another embodiment, the network 130 may be a GPRS (General Packet Radio Service) network. In another embodiment, the network 130 may be a FRS (Family Radio Service) network. In another embodiment, the network 130 may be any appropriate cellular data network or cell-based radio network technology. In another embodiment, the network 130 may be an IEEE 802.11B wireless network. In still another embodiment, the network 130 may be any suitable network or combination of networks. Although one network 130 is shown, in other embodiments any number of networks (of the same or different types) may be present.
The computer system 100 depicted in
It should be understood that
The various software components illustrated in
Moreover, while embodiments of the invention have and hereinafter will be described in the context of fully functioning computer systems, the various embodiments of the invention are capable of being distributed as a program product in a variety of forms, and the invention applies equally regardless of the particular type of signal-bearing medium used to actually carry out the distribution. The programs defining the functions of this embodiment may be delivered to the computer system 100 via a variety of signal-bearing media, which include, but are not limited to:
Such signal-bearing media, when carrying machine-readable instructions that direct the functions of the present invention, represent embodiments of the present invention.
In addition, various programs described hereinafter may be identified based upon the application for which they are implemented in a specific embodiment of the invention. But, any particular program nomenclature that follows is used merely for convenience, and thus embodiments of the invention should not be limited to use solely in any specific application identified and/or implied by such nomenclature.
The exemplary environment illustrated in
Locale, ccsid, architecture, and environment are all conditions that the symbolic link 170 can use to determine the object to return, but in other embodiments any appropriate condition may be used.
The interface 200 further includes example commands 210, 215, and 220, which use the example syntax 205. In the example of
Thus, the example command 210 requests the file system 176 to create a typed n-way symbolic link 170 having a locale condition of “en_US,” which, in this example, is the default, with the target directory being “doc/en” and the name of the n-way symbolic link 170 being “/doc.” The example command 215 requests the file system 176 to create a typed n-way symbolic link having a locale condition of “es_ES” with the target directory being “doc/es” and the name of the n-way symbolic link 170 being “/doc.” The example command 220 requests the file system 176 to create a typed n-way symbolic link having a locale condition of “fr_FR” with the target directory being “doc/fr” and the name of the n-way symbolic link 170 being “/doc.” Since all of the commands 210, 215, and 220 specify the same link name (“/doc” in this example), the file system 176 creates a single symbolic link 170 having pointers for each of the pathnames of the target directories, which may be selected by a locale specified in the user environment 174. Thus, when the program 169 of the computer system 100 access the n-way symbolic link 170 via the command 225 (a change directory command), the file system 176 retrieves the locale (en_US) from the user environment 174, and uses it to determine the correct target object 172.
The syntax, commands, and data illustrated in
Each of the entries 310, 315, and 320 includes a condition field 325 and a pointer or address field 330. The condition field 325 includes a condition or criteria that may be used to select among the pointers 330. Using the example data of
Control then continues to block 410 where the file system 176 detects accessing of the n-way symbolic link 170 by the program 169. An example of accessing the n-way symbolic link 170 is illustrated in
Control then continues to block 420 where the file system 176 extracts the object pointer or address 330 using the condition 302 and the list of object addresses 305. If the condition 302 does not exist, then the file system 176 uses the default condition, which in the example of
Control then continues to block 499 where the logic of
In the previous detailed description of exemplary embodiments of the invention, reference was made to the accompanying drawings (where like numbers represent like elements), which form a part hereof, and in which is shown by way of illustration specific exemplary embodiments in which the invention may be practiced. These embodiments were described in sufficient detail to enable those skilled in the art to practice the invention, but other embodiments may be utilized and logical, mechanical, electrical, and other changes may be made without departing from the scope of the present invention. Different instances of the word “embodiment” as used within this specification do not necessarily refer to the same embodiment, but they may. The previous detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims.
In the previous description, numerous specific details were set forth to provide a thorough understanding of the invention. But, the invention may be practiced without these specific details. In other instances, well-known circuits, structures, and techniques have not been shown in detail in order not to obscure the invention.