Filename extension
A filename extension, also known as file name extension or file extension, is a suffix to the name of a computer file (for example, .txt, .mp3, .exe) that indicates a characteristic of the file contents or its intended use. A filename extension is typically delimited from the rest of the filename with a full stop (period), but in some systems[1] it is separated with spaces.
Some file systems, such as the FAT file system used in DOS, implement filename extensions as a feature of the file system itself and may limit the length and format of the extension, while others, such as Unix file systems, the VFAT file system, and NTFS, treat filename extensions as part of the filename without special distinction.
History
The basic concept of extensions to indicate the type of file was first introduced in MIT's CTSS in 1961. This system stored two separate names for each file, file name and class name, corresponding to today's name and extension. Internally, they were stored in different fields in the file system, but to ease entry, the user specified the type using a dot, which was then removed when the file was stored. Running on the IBM 7090, each file entry had four 36-bitcomputer words to store the information, with the first two words containing up to 6 characters for the name and class, respectively.[2]
IBM adopted CTSS concepts as the basis for their own time-sharing experiments at the Cambridge Scientific Center in the same MIT building where CTSS was being written. This developed into the Conversational Monitor System (originally Cambridge) for the System/360.[3] The concept was also adopted early on by DEC's experiments in time-sharing on the PDP-6 and it's follow-on, the PDP-10. The later became TOPS-10, one of DEC's main offerings into the 1980s, followed by RT-11. It was DEC's versions that inspired later microcomputer operating systems to adopt the same concept, first with CP/M[4] and then DOS.
The Multics file system took this concept further by adopting the concept of making the extension part of the filename itself, as opposed to a separated dedicated type flag. This was part of a broader expansion of the file system which included variable-length names up to 255 characters long. With names this long, there was no need to dedicate storage just to the type, and the "." was just another character in the name. Some components of Multics, and applications running on it, use suffixes to indicate file types, but not all files are required to have a suffix — for example, executables and ordinary text files usually have no suffixes in their names. It was normally the user-facing utilities that examined the name for the last dotted portion to retrieve the type, if desired.[5] Multics was the impetus for UNIX,[6] which followed the same pattern.
Operating system and file system support
File systems for UNIX-like operating systems also store the file name as a single string, with "." as just another character in the file name. A file with more than one suffix is sometimes said to have more than one extension, although terminology varies in this regard, and most authors define extension in a way that does not allow more than one in the same file name. More than one extension usually represents nested transformations, such as files.tar.gz (the .tar indicates that the file is a tar archive of one or more files, and the .gz indicates that the tar archive file is compressed with gzip). Programs transforming or creating files may add the appropriate extension to names inferred from input file names (unless explicitly given an output file name), but programs reading files usually ignore the information; it is mostly intended for the human user. It is more common, especially in binary files, for the file to contain internal or external metadata describing its contents. This model generally requires the full filename to be provided in commands, whereas the metadata approach often allows the extension to be omitted.
In DOS and 16-bit Windows, file names have a maximum of 8 characters, a period, and an extension of up to three letters. The FAT file system for DOS and Windows stores file names as an 8-character name and a three-character extension. The period character is not stored.
يخزن نظام الملفات عالي الأداء (HPFS)، المستخدم في نظامي التشغيل OS/2 من مايكروسوفت وآي بي إم ، اسم الملف كسلسلة نصية واحدة، حيث تُعتبر النقطة (.") مجرد حرف إضافي في اسم الملف. واستمر استخدام اللواحق، على الرغم من أن نظام HPFS يدعم السمات الموسعة للملفات، مما يسمح بتخزين نوع الملف كسمة موسعة فيه.
يخزن نظام الملفات الأصلي لنظام التشغيل ويندوز إن تي من مايكروسوفت ، NTFS ، وكذلك نظام الملفات ReFS اللاحق ، اسم الملف كسلسلة نصية واحدة؛ واستمر استخدام اللواحق لمحاكاة الامتدادات، وذلك لضمان التوافق مع الإصدارات السابقة من ويندوز. في ويندوز إن تي 3.5 ، ظهر نظام ملفات VFAT ، وهو نسخة معدلة من نظام FAT، يدعم أسماء ملفات أطول، حيث يُعامل اسم الملف كسلسلة نصية واحدة.
أدخل نظام التشغيل Windows 95 ، مع VFAT، دعمًا لأسماء الملفات الطويلة، وأزال تقسيم الاسم/الامتداد في أسماء الملفات من نظام التشغيل Windows غير NT.
تخلّى نظام التشغيل ماك الكلاسيكي تمامًا عن بيانات تعريف امتداد الملفات المستندة إلى الاسم؛ واستخدم بدلًا من ذلك رمزًا مميزًا لنوع الملف لتحديد تنسيقه. بالإضافة إلى ذلك، تم تحديد رمز المُنشئ لتحديد التطبيق الذي سيتم تشغيله عند النقر المزدوج على أيقونة الملف . [ 7 ] مع ذلك ، يستخدم نظام macOS لاحقات أسماء الملفات نتيجةً لاشتقاقه من نظام التشغيل NeXTSTEP الشبيه بنظام UNIX ، إلى جانب استخدام رموز النوع والمُنشئ.
في أنظمة كومودور، لا يمكن أن تحتوي الملفات إلا على أربعة امتدادات: PRG وSEQ وUSR وREL. ومع ذلك، تُستخدم هذه الامتدادات لفصل أنواع البيانات التي يستخدمها البرنامج، وهي غير ذات صلة بتحديد محتويات الملفات.
مع ظهور واجهات المستخدم الرسومية ، برزت مسألة إدارة الملفات وسلوك الواجهة. سمح نظام مايكروسوفت ويندوز بربط تطبيقات متعددة بامتداد معين، وتوفرت إجراءات مختلفة لاختيار التطبيق المطلوب، مثل قائمة السياق التي تتيح الاختيار بين عرض الملف أو تحريره أو طباعته. كان الافتراض السائد آنذاك أن كل امتداد يمثل نوع ملف واحد؛ إذ كان هناك ربط واضح بين الامتداد والأيقونة.
مع بداية عصر الإنترنت ، اضطر مستخدمو أنظمة ويندوز، التي كانت لا تزال مقيدة بصيغ أسماء الملفات 8.3،.HTM إلى إنشاء صفحات ويب بأسماء تنتهي بـ .، بينما كان بإمكان مستخدمي أجهزة ماكنتوش أو يونكس استخدام .htmlامتداد اسم الملف الموصى به. وقد شكل هذا الأمر مشكلةً أيضًا للمبرمجين الذين يجربون لغة برمجة جافا ، إذ تتطلب هذه اللغة لاحقة من أربعة أحرف .javaلملفات الشيفرة المصدرية ، ولاحقة من خمسة أحرف لملفات مخرجات شيفرة كائنات مترجم.class جافا . [ 8 ]
نوع المحتوى
يمكن اعتبار امتدادات أسماء الملفات نوعًا من البيانات الوصفية . [ 9 ] وهي تُستخدم عادةً للإشارة إلى معلومات حول كيفية تخزين البيانات في الملف. أما التعريف الدقيق، الذي يحدد معايير تحديد الجزء من اسم الملف الذي يُمثل امتداده، فيخضع لقواعد نظام الملفات المُستخدم؛ وعادةً ما يكون الامتداد هو السلسلة الفرعية التي تلي آخر ظهور للنقطة، إن وُجدت ( مثال :txt هو امتداد اسم الملف readme.txt، و htmlهو امتداد index.html). في أنظمة ملفات بعض أنظمة الحواسيب المركزية مثل CMS في VM و VMS ، وأنظمة الحواسيب الشخصية مثل CP/M والأنظمة المشتقة منها مثل MS-DOS ، يُمثل الامتداد مساحة اسم منفصلة عن اسم الملف. في نظامي التشغيل DOS و Windows من مايكروسوفت ، تُشير امتدادات مثل EXEأو COMإلى BATأن الملف هو برنامج قابل للتنفيذ . في نظام التشغيل OS/360 والأنظمة اللاحقة ، يتم التعامل مع جزء اسم مجموعة البيانات الذي يلي النقطة الأخيرة، والذي يسمى المؤهل منخفض المستوى، على أنه امتداد بواسطة بعض البرامج، على سبيل المثال، TSO EDIT، ولكن ليس له أهمية خاصة لنظام التشغيل نفسه؛ وينطبق الشيء نفسه على ملفات Unix في MVS.
The filename extension was originally used to determine the file's generic type. The need to condense a file's type into three characters frequently led to abbreviated extensions. Examples include using .GFX for graphics files, .TXT for plain text, and .MUS for music. However, because many different software programs have been made that all handle these data types (and others) in a variety of ways, filename extensions started to become closely associated with certain products—even specific product versions. For example, early WordStar files used .WS or .WSn, where n was the program's version number. Also, conflicting uses of some filename extensions developed. One example is .rpm, used for both RPM Package Manager packages and RealPlayer Media files;.[10] Others are .qif, shared by DESQview fonts, Quicken financial ledgers, and QuickTime pictures;[11].gba, shared by GrabIt scripts and Game Boy Advance ROM images;[12].sb, used for SmallBasic and Scratch; and .dts, being used for Dynamix Three Space and DTS.
Compared to MIME type
In many Internet protocols, such as HTTP and MIME email, the type of a bitstream is stated as the media type, or MIME type, of the stream, rather than a filename extension. This is given in a line of text preceding the stream, such as Content-type: text/plain.
There is no standard mapping between filename extensions and media types, resulting in possible mismatches in interpretation between authors, web servers, and client software when transferring files over the Internet. For instance, a content author may specify the extension svgz for a compressed Scalable Vector Graphics file, but a web server that does not recognize this extension may not send the proper content type application/svg+xml and its required compression header, leaving web browsers unable to correctly interpret and display the image.
BeOS, whose BFS file system supports extended attributes, would tag a file with its media type as an extended attribute. Some desktop environments, such as KDE Plasma and GNOME, associate a media type with a file by examining both the filename suffix and the contents of the file, in the fashion of the file command, as a heuristic. They choose the application to launch when a file is opened based on that media type, reducing the dependency on filename extensions. macOS uses both filename extensions and media types, as well as file type codes, to select a Uniform Type Identifier by which to identify the file type internally.
Executable programs
The use of a filename extension in a command name appears occasionally, usually as a side effect of the command having been implemented as a script, e.g., for the Bourne shell or for Python, and the interpreter name being suffixed to the command name, a practice common on systems that rely on associations between filename extension and interpreter, but sharply deprecated[13] in Unix-like systems, such as Linux, Oracle Solaris, BSD-based systems, and Apple's macOS, where the interpreter is normally specified as a header in the script ("shebang").
On association-based systems, the filename extension is generally mapped to a single, system-wide selection of interpreter for that extension (such as ".py" meaning to use Python), and the command itself is runnable from the command line even if the extension is omitted (assuming appropriate setup is done). If the implementation language is changed, the command name extension is changed as well, and the OS provides a consistent API by allowing the same extensionless version of the command to be used in both cases. This method suffers somewhat from the essentially global nature of the association mapping, as well as from developers' incomplete avoidance of extensions when calling programs, and that developers can not force that avoidance. Windows is the only remaining widespread employer of this mechanism.
On systems with interpreter directives, including virtually all versions of Unix, command name extensions have no special significance, and are by standard practice not used, since the primary method to set interpreters for scripts is to start them with a single line specifying the interpreter to use. In these environments, including the extension in a command name unnecessarily exposes an implementation detail which puts all references to the commands from other programs at future risk if the implementation changes. For example, it would be perfectly normal for a shell script to be reimplemented in Python or Ruby, and later in C or C++, all of which would change the name of the command were extensions used. Without extensions, a program always has the same extension-less name, with only the interpreter directive or magic number changing, and references to the program from other programs remain valid.
Security issues
File extensions alone are not a reliable indicator of a file's type, as the extension can be modified without changing the file's contents, such as to disguise malicious content. Therefore, especially in the context of cybersecurity, for a file in a file format that has a magic number, which is a distinctive sequence of bytes affixed to a file's header, the file's true nature should be determined by checking the magic number. This is accomplished using file identification software or a hex editor, which provides a hex dump of a file's contents.[14] For example, on UNIX-like systems, it is not uncommon to find files with no extensions at all,[15] as commands such as file are meant to be used instead, and will read the file's header to determine its content.
Malware such as Trojan horses typically takes the form of an executable, but any file type that performs input/output operations may contain malicious code. A few data file types such as PDFs have been found to be vulnerable to exploits that cause buffer overflows.[16] There have been instances of malware crafted to exploit such vulnerabilities in some Windows applications when opening a file with an overly long, unhandled filename extension.
File managers may have an option to hide filenames extensions. This is the case for File Explorer, the file browser provided with Microsoft Windows, which by default does not display extensions. Malicious users have tried to spread computer viruses and computer worms by using file names formed like LOVE-LETTER-FOR-YOU.TXT.vbs. The idea is that this will appear as LOVE-LETTER-FOR-YOU.TXT, a harmless text file, without alerting the user to the fact that it is a harmful computer program, in this case, written in VBScript.[16] The default behavior for ReactOS is to display filename extensions in ReactOS Explorer. Later Windows versions (starting with Windows XP Service Pack 2 and Windows Server 2003) included customizable lists of filename extensions that should be considered "dangerous" in certain "zones" of operation, such as when downloaded from the web or received as an e-mail attachment. Modern antivirus software systems also help to defend users against such attempted attacks where possible.
A virus may couple itself with an executable without actually modifying the executable. These viruses, known as companion viruses, attach themselves in such a way that they are executed when the original file is requested. One way such a virus does this involves giving the virus the same name as the target file, but with a different extension to which the operating system gives priority, and often assigning the former a "hidden" attribute to conceal the malware's existence. The efficacy of this approach depends on whether the user attempts to open the intended file by entering a command and whether the user includes the extension. Later versions of DOS and Windows check for and attempt to run .COM files first by default, followed by .EXE and finally .BAT files. In this case, the infected file is the one with the .COM extension, which the user unwittingly executes.[15][16]
Some viruses take advantage of the similarity between the ".com" top-level domain and the .COM filename extension by emailing malicious, executable command-file attachments under names superficially similar to URLs (e.g., "myparty.yahoo.com"), with the effect that unaware users click on email-embedded links that they think lead to websites but actually download and execute the malicious attachments.
See also
مراجع
- ↑ "ما هو الملف؟" (ملف PDF) . دليل z/VM 7.2 CMS التمهيدي (ملف PDF) . IBM. 2021-12-05. ص 7. SC24-6265-01.
من الأمور التي يجب معرفتها عند إنشاء الملفات باستخدام z/VM أن كل ملف يحتاج إلى مُعرّف خاص به يتكون من ثلاثة أجزاء. الجزء الأول من المُعرّف هو اسم الملف. الجزء الثاني هو نوع الملف. والجزء الثالث هو وضع الملف. غالبًا ما يتم اختصار هذه المُعرّفات الثلاثة للملفات إلى fn ft fm.
- ↑ CTSS 1963 ، ص 24.
- ↑ "أصل نظام المشاركة الزمنية VM/370" (ملف PDF) . مجلة IBM للبحوث والتطوير . سبتمبر 1981. مؤرشف (ملف PDF) من الأصل بتاريخ 7 مارس 2022. تم الاطلاع عليه بتاريخ 31 مايو 2026 .
- ↑ وارن، جيم (أبريل 1976). "أول كلمة عن نظام تشغيل القرص المرن". مجلة دكتور دوب . المجلد 1، العدد 4، ص 5.
- ↑ "نظام ملفات للأغراض العامة للتخزين الثانوي" . وقائع مؤتمر الحاسوب المشترك لخريف 30 نوفمبر - 1 ديسمبر 1965، الجزء الأول . 30 نوفمبر 1965. مؤرشف من الأصل في 6 ديسمبر 2025. تم الاطلاع عليه في 31 مايو 2026 .
- ↑ براون، جوردون. يونكس: تاريخ شفوي (تقرير فني).
- ↑ "رموز Mac Creator وأنواع الملفات" . livecode.byu.edu . مؤرشف من الأصل بتاريخ 2022-07-02 . تم الاطلاع عليه بتاريخ 2022-09-02 .
- ↑ "javac – مُصرّف لغة برمجة جافا" . شركة صن مايكروسيستمز، 2004. تم الاطلاع عليه بتاريخ 31-05-2009 .
يجب أن تحتوي أسماء ملفات الشيفرة المصدرية على اللاحقة .java، ويجب أن تحتوي أسماء ملفات الفئات على اللاحقة .class، ويجب أن تحتوي كل من ملفات الشيفرة المصدرية وملفات الفئات على أسماء جذرية تُعرّف الفئة.
- ↑ ستوفر، تود؛ ماكيلهيرن، كيرك (2006). إتقان نظام التشغيل ماك أو إس إكس . جون وايلي وأولاده. الصفحات 95-96 . ISBN 9780782151282تم الاطلاع عليه بتاريخ 2 أكتوبر 2017 .
- ↑ تفاصيل امتداد الملف .RPM من موقع filext.com
- ↑ تفاصيل امتداد الملف .QIF مؤرشفة بتاريخ 16-12-2007 على موقع Wayback Machine من موقع filext.com
- ↑ امتداد الملف .GBA تمت أرشفة التفاصيل بتاريخ 13 ديسمبر 2007 على موقع Wayback Machine من موقع filext.com
- ↑ "امتدادات أسماء الأوامر تُعتبر ضارة" . مؤرشف من الأصل بتاريخ 16-06-2011 . تم الاطلاع عليه بتاريخ 04-12-2010 .
- ↑ أكويلينا، جيمس م.؛ كيسي، إيوجان ؛ مالين، كاميرون هـ. (2008). الطب الشرعي للبرمجيات الخبيثة: التحقيق في الشفرة الخبيثة وتحليلها . سينغريس . الصفحات 211، 298-299 . ISBN 978-1-59749-268-3تم الاطلاع عليه بتاريخ 25-02-2025 .
- 1 2 سكوديس، إد؛ زيلتسر، ليني (2004). البرمجيات الخبيثة: مكافحة التعليمات البرمجية الخبيثة . برنتيس هول . الصفحات 32-34 ، 253-254 . ISBN 0-13-101405-6أُرشف من المصدر الأصلي بتاريخ 2025-07-01 . تم الاطلاع عليه بتاريخ 2025-02-25 .
- 1 2 3 غرايمز، روجر (أغسطس 2001). البرمجيات الخبيثة للهواتف المحمولة: الحماية من الفيروسات لنظام ويندوز . دار نشر أورايلي ميديا . الصفحات 41-42 ، 71-74 ، 221-222 ، 395-396 ، 422. ISBN 1-56592-682-Xتم الاطلاع عليه بتاريخ 25-02-2025 .
فهرس
- نظام المشاركة الزمنية المتوافق: دليل المبرمج (PDF) . معهد ماساتشوستس للتكنولوجيا. 1963.
روابط خارجية
الوسائط المتعلقة بامتدادات أسماء الملفات على ويكيميديا كومنز- قاعدة بيانات امتدادات أسماء الملفات على موقع FileInfo.com
- تنسيقات ملفات الحاسوب
- البيانات الوصفية
- ملفات الكمبيوتر
- الأسماء
- امتدادات أسماء الملفات
