请输入您要查询的百科知识:

 

词条 Filename mangling
释义

  1. FAT Derivative Filesystem

     Legacy support under VFAT 

  2. Unix Filesystems

  3. Mac OS

  4. References

{{about|the mangling of filenames for operating system compatibility|the concept of name mangling within compilers|name mangling}}{{Refimprove|date=July 2007}}

The process of filename mangling, in computing, involves a translation of the file name for compatibility at the operating system level. It occurs when a filename on a filesystem appears in a form incompatible with the operating system accessing it. Such mangling occurs, for example, on computer networks when a Windows machine attempts to access a file on a Unix server and that file has a filename which includes characters not valid in Windows.

FAT Derivative Filesystem

{{main|File Allocation Table|8.3}}

Legacy support under VFAT

A common example of name mangling occurs on VFAT file systems on versions of Windows from Windows 95 onwards. The VFAT specification{{clarify|date=December 2016}} allows Long File Names (LFNs). For backwards-compatibility with MS-DOS and older Windows software, which recognizes filenames of a maximum of 11 characters in length with 8.3 format (i.e.: an eight-letter filename, a dot and a three-letter extension, such as autoexec.bat), files with LFNs get stored on disk in 8.3 format (longfilename.txt becoming longfi~1.txt), with the long file name stored elsewhere on the disk.

Normally{{clarify|date=December 2016}}, when using compatible Windows programs which use standard Windows methods{{which|date=December 2016}} of reading the disk, the I/O subsystem returns the long filename to the program — however, if an old DOS application or an old Windows application tries to address the file, it will use the older, 8.3-only APIs, or work at a lower level and perform its own disk access, which results in the return of an 8.3 filename. In this case, the filenames become mangled by taking the first six non-space characters in the filename and adding a tilde (~) and then a number to ensure the uniqueness of the 8.3 filename on the disk. This mangling scheme can turn (for example) Program Files into PROGRA~1. This technique persists today when people use DOSBox to play classic DOS games or use Windows 3.1 in conjunction to play Win16 games on 64-bit Windows.

Unix Filesystems

{{which|date=December 2016}}

Unix file names can contain colons or backslashes, whereas Windows interprets such characters in other{{which|date=December 2016}} ways. Accordingly{{clarify|date=December 2016}}, software could mangle the Unix file "Notes: 11\\04\\03" as "Notes_ 11-04-03" to enable Windows software to remotely access the file. Other Unix-like systems, such as Samba on Unix, use different{{clarify|date=December 2016}} mangling systems to map long filenames to DOS-compatible filenames (although Samba administrators can configure this behavior in the config file).[1]

Mac OS

macOS's Finder displays instances of ":" in file and directory names with a "/". This is because the classic Mac OS used the ":" character internally as a path separator. Listing these files or directories using a terminal emulator displays a ":" rather than the "/" character, though.

References

1. ^{{cite book|last= Eckstein|first= Robert|authorlink=|author2=David Collier-Brown |author3=Peter Kelly |firstn= |lastn=|authorn-link=|editor=|editorn=|editorn-last=|editorn-first=|editor-link=|editorn-link=|others=|title= Using Samba|trans-title=|url= http://oreilly.com/catalog/samba/chapter/book/ch05_04.html|accessdate= 2009-10-23|edition= 1st|series=|volume=|date= November 1999|origyear=|publisher= O'Reilly & Associates, Inc|location=|language=|isbn=|oclc=|doi=|bibcode=|id=|page=|pages=|nopp=|chapter= 5.4 Name Mangling and Case|trans-chapter=|chapterurl=|quote=|ref=|laysummary=|laydate=|separator=|postscript= |lastauthoramp=}}
{{Computer files}}

2 : Computer file systems|Computer files

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/20 13:32:54