Universal Naming Convention

UNC paths provide a standardized way of accessing files and devices over a network without having to specify or reference a local drive letter that has been mapped to a remote file system. This is important because it allows applications to become drive letter-independent and work seamlessly in a network environment. UNC names are better than names that reference a local drive letter because you don't have to worry about running out of drive letters when forming connections to access server shares. Drive letters also operate on a per-user basis—processes that are not running in your user context cannot access your drive mappings.

UNC names are specified as follows:

 \\[server]\[share]\[path] 

The first portion, \\[server], starts with two backslashes followed by a server name. The server name represents a remote server in which an application wants to reference a remote file. The second portion, \[share], represents a share point on the remote server. A share point is simply a directory in a file system that is identified on a network as shared for network user access. The third portion, \[path], represents a directory path to a file in a file system. For example, suppose you have a server named Myserver that contains a directory on a local drive named D:\Myfiles\CoolMusic that is shared out as Myshare. Let's also assume the shared directory contains a file named Sample.mp3. If you would like to reference Sample.mp3 from a remote machine, simply specify the following UNC name:

 \\Myserver\Myshare\Sample.mp3 

As you can see, it's much easier to reference a file across a network than it is to map a local drive to the shared directory Myshare.

Referencing files over a network using UNC names hides the details of forming a connection over a network from an application. This is great—a system can easily locate network server directory shares and file paths with UNC names, even over a modem connection. All of the network communication details are handled by a network provider's redirector, which we will discuss later in this chapter. As we will see in Chapters 3 and 4, the mailslot and named pipe technologies depend solely on the use of UNC names for identification.

Figure 2-1 illustrates the common components that form UNC connections on the network operating system in Windows. The figure also shows how the data flows among client and server NOS components. Using the UNC path \\Myserver\Myshare\Sample.mp3 described above, the remainder of this chapter will describe each component and demonstrate what happens when we open this file across a network.

click to view at full size.

Figure 2-1. Redirector components



Network Programming for Microsoft Windows
Linux Server Hacks, Volume Two: Tips & Tools for Connecting, Monitoring, and Troubleshooting
ISBN: 735615799
EAN: 2147483647
Year: 1998
Pages: 159

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net