Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Filename mangling

From Wikipedia, the free encyclopedia
Translation of the file name for compatibility at the operating system level
This article is about the mangling of filenames for operating system compatibility. For the concept of name mangling within compilers, seename mangling.
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Filename mangling" – news ·newspapers ·books ·scholar ·JSTOR
(July 2007) (Learn how and when to remove this message)

The process offilename mangling, incomputing, involves a translation of the file name for compatibility at theoperating system level. It occurs when afilename on afilesystem appears in a form incompatible with the operating system accessing it. Such mangling occurs, for example, oncomputer networks when aWindows machine attempts to access a file on aUnix server and that file has a filename which includes characters not valid in Windows.

FAT Derivative Filesystem

[edit]
Main articles:File Allocation Table and8.3

Legacy support under VFAT

[edit]

A common example of name mangling occurs onVFAT file systems on versions of Windows fromWindows 95 onwards. The VFAT specification[clarification needed] allowsLong File Names (LFNs). For backwards-compatibility withMS-DOS and older Windows software, which recognizes filenames of a maximum of 11 characters in length with8.3 format (i.e.: an eight-letter filename, a dot and a three-letter extension, such asautoexec.bat), files with LFNs get stored on disk in 8.3 format (longfilename.txt becominglongfi~1.txt), with the long file name stored elsewhere on the disk.

Normally[clarification needed], when using compatible Windows programs which use standard Windows methods[which?] of reading the disk, theI/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 atilde (~) 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 intoPROGRA~1. This technique persists today when people useDOSBox to play classic DOS games or useWindows 3.1 in conjunction to playWin16 games on 64-bit Windows.

Unix Filesystems

[edit]

[which?]

Unix file names can containcolons orbackslashes, whereas Windows interprets such characters in other[which?] ways. Accordingly[clarification needed], software could mangle the Unix file "Notes: 11\04\03" as "Notes_ 11-04-03" to enable Windows software to remotely access the file. OtherUnix-like systems, such asSamba on Unix, use different[clarification needed] mangling systems to map long filenames to DOS-compatible filenames (although Samba administrators can configure this behavior in the config file).[1]

Mac OS

[edit]

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

References

[edit]
  1. ^Eckstein, Robert; David Collier-Brown; Peter Kelly (November 1999). "5.4 Name Mangling and Case".Using Samba (1st ed.). O'Reilly & Associates, Inc. Retrieved2009-10-23.


Types
Properties
Organisation
Operations
Linking
Management
Retrieved from "https://en.wikipedia.org/w/index.php?title=Filename_mangling&oldid=1249225935"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp