Win4Lin User's Guide |
Appendix C -- Filename mapping |
(User's Guide Table of Contents) | (Appendix Table of Contents) |
Previous - Appendix B - National language support |
On a regular Windows 95 or 98 system, Windows provides a mapping of long file names to short names for those older applications. (This file name mapping is also known as "file name mangling.") Win4Lin provides a similar mapping for those older applications. By default the mapping done on each user's private drive C is a standard Windows 9x mapping. The mapping of filenames on other parts of the Linux filesystem is slightly different. The style of filename mapping should not concern most people.
This appendix covers these filename mapping issues.
Win4Lin has several different mapping styles that can be used. Each different drive letter that provides access to the Linux filesystem can (and does) use different styles. This is because there is no "best" style that works for all situations. It would be best if the Windows 9x style could be used for all drives, but due to several restrictions, it can only be used on drives that only one Win4Lin session uses at a time and the user must have permission to write in the directories. Thus by default only the user's personal C drive uses this mapping.
Normally the default mapping style for each drive should be used
unless you have some special need to use a different mapping.
Also note that chaning the mapping style of a drive could cause
problems with some apps that remember mapped file and directory names.
If you change the mapping, then those apps will not
be able to find things!
Win 9x style mapping
There are two differences between the long file name support
that Windows 9x provides and that which Linux provides:
Because hidden subdirectores are used to save "Win9x" style mapping information, the user must have permission to create subdirectories for this mapping style to work.
Note: For performance reasons, file access to the C drive is heavily buffered, which means that it is important that no other process access files in those directories while the Windows session is running.
Mapping of Linux file names
The above section explained what the "Windows 9x style" mapping does.
Unfortunatly this cannot be generally used for Linux filenames.
Win4Lin provides two other mapping styles you can choose from:
With both of these, Win4Lin creates a mapped name by appending a unique index consisting of an apostrophe or tilde followed by one or more characters. If necessary, Win4Lin truncates the original name before appending the index. Characters that are not valid for DOS file names, such as the space or the plus sign, are either replaced with an underscore or removed. For example, a file called messagetoall might be mapped to the name MESS'BAQ.
The following table shows how Win4Lin might map various types of Windows or Linux names.
--------------------------------------------------- Linux name Mapped name --------------------------------------------------- messagetoall MESS'BAQ message.tobob MESS'BBF.TOB +.ok _'PP.OK okbase.:++ OKBAS'QW._ _ _ a.b.c A_B'SV.C
Standard vs. Old-Style mapping
The disadvantage of this method is that a unique mapping is not always possible, and two different file names could be mapped to the same DOS-style name. If this creates a problem, use Old-Style Mapping.
This method uses a hash function to create DOS-style
file names from the Linux inode associated with the file.
Thus a unique mapping is always created.
The disadvantage of this method is that the mapping changes if the file is copied in such a way that the inode number is changed. If this creates a problem, use Standard Mapping.
(This is called "old-style" because this mapping method was the only one available with older versions of the mapping technology used in Win4Lin.)
Although you always use a file's mapped name with DOS applications, you sometimes want to know the original file or directory name. You do this using the DOS dir command in a DOS box (a.k.a "MS-DOS Prompt") started from Windows. This command shows both the mapped and actual file name.
Filename case sensitivity
Regardless of the mapping method you choose, you can
enable the
Case Mapping
option for each Linux drive.
On Linux filesystems case is significant in filenames, but not for DOS and Windows filesystems:
For files on your personal (C) drive, this is rarely an issue because Windows applications create and manipulate the files and no conflicting names can be created. The difficulty arises if you use Linux to create conflicting names.
When using a Windows 9x application if you specify the filename with the case as the actual Linux filename has, you will get the correct file. But, if you specify the name with some other case or access it from a pre-Windows 9x application, and files with conflicting names exist, it is not predictable which file you will get.
The solution to this is to enable "Case Mapping". This causes Win4Lin to treat Linux file names that have uppercase characters as invalid DOS file names and map them. This allows you to access all file names unambiguously, but at the cost of causing file names to be mapped that otherwise seem to be valid DOS or Windows file names.
By default "Case Mapping" is not enabled, since it is rare to have multiple files in the same directory whose names differ only in case.
See ``File name mapping options'' in Chapter 4 for more information about how to change the file-name mapping settings in your drive configuration.