A resource fork is a fork of a file on Apple 's classic Mac OS operating system that is used to store structured data. It is one of the two forks of a file, along with the data fork , which stores data that the operating system treats as unstructured. Resource fork capability has been carried over to the modern macOS for compatibility.
87-414: A resource fork stores information in a specific form, containing details such as icon bitmaps, the shapes of windows, definitions of menus and their contents, and application code ( machine code ). For example, a word processing file might store its text in the data fork, while storing any embedded images in the same file's resource fork. The resource fork is used mostly by executables , but any file can have
174-414: A WSDL description of a remote web service can be viewed as a form of reference; it includes a complete specification of how to locate and bind to a particular web service . A reference to a live distributed object is another example: it is a complete specification for how to construct a small software component called a proxy that will subsequently engage in a peer-to-peer interaction, and through which
261-492: A code obfuscation technique as a measure against disassembly and tampering. The principle is also used in shared code sequences of fat binaries which must run on multiple instruction-set-incompatible processor platforms. This property is also used to find unintended instructions called gadgets in existing code repositories and is used in return-oriented programming as alternative to code injection for exploits such as return-to-libc attacks . In some computers,
348-487: A database . ( Microsoft Windows also has a concept of " resources ", but these are completely unrelated to resources in Mac OS.) The Macintosh file systems store metadata distinct from either the data or resource fork, such as the creation and modification timestamps, the file type and creator codes, and fork lengths. Some files have only a resource fork. One example is a font file in the classic Mac OS. Another example
435-572: A physical address on a storage device, or a network address such as a URL . A reference R is a value that admits one operation, dereference ( R ), which yields a value. Usually the reference is typed so that it returns values of a specific type, e.g.: Often the reference also admits an assignment operation store ( R , x ), meaning it is an abstract variable . References are widely used in programming , especially to efficiently pass large or mutable data as arguments to procedures , or to share such data among various uses. In particular,
522-449: A reference is a value that enables a program to indirectly access a particular datum , such as a variable 's value or a record , in the computer 's memory or in some other storage device . The reference is said to refer to the datum, and accessing the datum is called dereferencing the reference. A reference is distinct from the datum itself. A reference is an abstract data type and may be implemented in many ways. Typically,
609-421: A dedicated language, also called Rez, which can be used to create a resource fork by compiling source code . A decompiler, DeRez, which can be used to change a resource fork back into Rez code is also included. In the structure of the resource fork, there is a piece of data called a "resource map" which stores the positions of resource data items. This can be used to allow random access to resource data based on
696-513: A fashion somewhat more analogous to the Mac. AmigaOS does not use forked files. Its executable files are internally divided into a modular structure of large pieces ( hunk ) capable of storing code, data, and additional information. Similarly, data and project files have a chunk structure codified in the IFF standard. Other file types are stored similarly to other operating systems. Though not strictly
783-773: A file server seeking to present file systems to Macintosh clients must accommodate the resource fork as well as the data fork of files; UNIX servers providing AFP support usually implement this with hidden directories. Older applications written with the Carbon API have a potential issue when being ported to the current Intel Macs. While the Resource Manager and operating system know how to deserialize data correctly for common resources like ' snd ' or ' moov ', resources created using TMPL resources have to be byte swapped manually to ensure file interoperability between PPC and Intel-based versions of an application. (While
870-486: A machine with a single accumulator , the accumulator is implicitly both the left operand and result of most arithmetic instructions. Some other architectures, such as the x86 architecture, have accumulator versions of common instructions, with the accumulator regarded as one of the general registers by longer instructions. A stack machine has most or all of its operands on an implicit stack. Special purpose instructions also often lack explicit operands; for example, CPUID in
957-750: A mixture of 10.5 and 10.6 clients. A freshly installed 10.6 client will look for and store resource forks on an SMB volume in ADSes, but the 10.5 client will (by default) ignore ADSes and use AppleDouble format to handle forks. If a fileserver supports both AFP and NFS, then clients using NFS will store files in AppleDouble format, whereas AFP users will stored the resource fork natively. In those cases, compatibility can sometimes be maintained by forcing clients to use, or not use, AppleDouble format. Many fileservers providing AFP support do not natively support resource forks on their local file systems. In those cases
SECTION 10
#17327802278821044-433: A one-to-one mapping to machine code. The assembly language decoding method is called disassembly . Machine code may be decoded back to its corresponding high-level language under two conditions: The first condition is to accept an obfuscated reading of the source code. An obfuscated version of source code is displayed if the machine code is sent to a decompiler of the source language. The second condition requires
1131-400: A paging based system, if the current page actually holds machine code by an execute bit — pages have multiple such permission bits (readable, writable, etc.) for various housekeeping functionality. E.g. on Unix-like systems memory pages can be toggled to be executable with the mprotect() system call, and on Windows, VirtualProtect() can be used to achieve a similar result. If an attempt
1218-508: A program such as ResEdit, making later editing simpler. As the Macintosh platform originated with Motorola-based processors (68k and PPC), the data is serialized to disk in big-endian format. The following is a list of the major data types, in alphabetical order. The type codes below, like the above datatypes, are used as type identifiers for more than resource forks themselves: they are used to identify file themselves, to describe data in
1305-475: A program, particularly due to dangling pointers or wild pointers . Smart pointers are opaque data structures that act like pointers but can only be accessed through particular methods. A handle is an abstract reference, and may be represented in various ways. A common example are file handles (the FILE data structure in the C standard I/O library ), used to abstract file content. It usually represents both
1392-399: A reference may point to a variable or record that contains references to other data. This idea is the basis of indirect addressing and of many linked data structures , such as linked lists . References increase flexibility in where objects can be stored, how they are allocated, and how they are passed between areas of code . As long as one can access a reference to the data, one can access
1479-463: A reference refers to data stored in memory on a given system, and its internal value is the memory address of the data, i.e. a reference is implemented as a pointer . For this reason a reference is often said to "point to" the data. Other implementations include an offset (difference) between the datum's address and some fixed "base" address, an index , or identifier used in a lookup operation into an array or table , an operating system handle ,
1566-413: A resource fork are called data types. There are several data types. After a resource fork is accessed, its contents can be found by reading it in as appropriate for the data types defined in advance. Placing definitions inside the program stating how data is to be treated makes it possible to store resources called TMPL resources as well. Using this method increases the visibility of the data when viewed with
1653-407: A resource fork, AmigaOS stores meta data in files known as .info files. .info files can be identified by the .info extension; for example, if you save a project to a disk, two files will be saved, MyProject and MyProject.info . MyProject would be the actual project data and MyProject.info would contain the project icon, information regarding which program is needed to open
1740-466: A resource fork. In a 1986 technical note, Apple strongly recommended that developers do not put general data into the resource fork of a file. According to Apple, there are parts of the system software that rely on resource forks having only valid Resource Manager information in them. The resource fork was conceived and implemented by Apple programmer Bruce Horn . The resource fork has three purposes in classic Macintosh file systems: The resource fork
1827-584: A resource manager for graphics objects, to save memory, originated in the OOZE package on the Xerox Alto in Smalltalk-76. The concept is now largely universal in all modern operating systems. However, the concept of the resource fork remains peculiar to the Macintosh. Most operating systems used a binary file containing resources, which is then "tacked onto" the end of an existing program file. This solution
SECTION 20
#17327802278821914-432: A special file. Networked file sharing protocols such as NFSv3 and FTP do not have a concept of file metadata, and so there is no way to natively store resource forks. This is also true when writing to certain types of local file systems, including UFS, and on SMB volumes where Alternate Data Stream support is not enabled. In those cases, macOS stores metadata and resource forks using a technique called AppleDouble , in which
2001-444: A tag and a Y field. In addition to transfer (branch) instructions, these machines have skip instruction that conditionally skip one or two words, e.g., Compare Accumulator with Storage (CAS) does a three way compare and conditionally skips to NSI, NSI+1 or NSI+2, depending on the result. The MIPS architecture provides a specific example for a machine code whose instructions are always 32 bits long. The general type of instruction
2088-640: A type of reference, where null is the image of a key not referring to anything meaningful. An alternative representation of such a function is a directed graph called a reachability graph . Here, each datum is represented by a vertex and there is an edge from u to v if the datum in u refers to the datum in v . The maximum out-degree is one. These graphs are valuable in garbage collection , where they can be used to separate accessible from inaccessible objects . In many data structures, large, complex objects are composed of smaller objects. These objects are typically stored in one of two ways: Internal storage
2175-444: Is computer code consisting of machine language instructions , which are used to control a computer's central processing unit (CPU). For conventional binary computers , machine code is the binary representation of a computer program which is actually read and interpreted by the computer. A program in machine code consists of a sequence of machine instructions (possibly interspersed with data). Each machine code instruction causes
2262-549: Is a Classic 68k application, where even the executable code is contained in resources of type 'CODE'. Later PowerPC binaries stored the executable code in the data fork. Since resource forks were supported only on Macintosh file systems including MFS, HFS, HFS Plus, and APFS, they could not be copied to the file systems of other operating systems . The Mac BinHex and MacBinary formats were invented to encode resource and data forks into one file, for transfer between systems. A/UX supported resource forks on Unix file systems via
2349-477: Is generally different from bytecode (also known as p-code), which is either executed by an interpreter or itself compiled into machine code for faster (direct) execution. An exception is when a processor is designed to use a particular bytecode directly as its machine code, such as is the case with Java processors . Machine code and assembly code are sometimes called native code when referring to platform-dependent parts of language features or libraries. From
2436-449: Is given by the op (operation) field, the highest 6 bits. J-type (jump) and I-type (immediate) instructions are fully specified by op . R-type (register) instructions include an additional field funct to determine the exact operation. The fields used in these types are: rs , rt , and rd indicate register operands; shamt gives a shift amount; and the address or immediate fields contain an operand directly. For example, adding
2523-453: Is implemented in all of the file systems used for system drives in the classic Mac OS ( MFS , HFS and HFS Plus ), and in the macOS -only APFS . The presence of a resource fork makes it easy to store a variety of additional information, such as an icon that the desktop should display for that file. While the data fork allows random access to any offset within it, access to the resource fork works like extracting structured records from
2610-428: Is made to execute machine code on a non-executable page, an architecture specific fault will typically occur. Treating data as machine code , or finding new ways to use existing machine code, by various techniques, is the basis of some security vulnerabilities. Similarly, in a segment based system, segment descriptors can indicate whether a segment can contain executable code and in what rings that code can run. From
2697-421: Is most commonly used to build singly linked lists , but can also be used to build simple binary trees and so-called "dotted lists", which terminate not with a null reference but a value. The pointer is still one of the most popular types of references today. It is similar to the assembly representation of a raw address, except that it carries a static datatype which can be used at compile-time to ensure that
Resource fork - Misplaced Pages Continue
2784-407: Is not available. The majority of programs today are written in a high-level language . A high-level program may be translated into machine code by a compiler . Every processor or processor family has its own instruction set . Instructions are patterns of bits , digits, or characters that correspond to machine commands. Thus, the instruction set is specific to a class of processors using (mostly)
2871-541: Is possible to use resources when developing an application. However, if the application may need to be used in UFS , it is also possible to configure it so that the entire resource fork is moved to the data fork, using the Raw Resource File setting. The integrated development environments distributed for free by Apple Inc. , which include MPW and Apple Developer's Tools , include a compiler called Rez. This uses
2958-400: Is preferred: Some languages, such as Java , Smalltalk , Python , and Scheme , do not support internal storage. In these languages, all objects are uniformly accessed through references. In assembly language , it is typical to express references using either raw memory addresses or indexes into tables. These work, but are somewhat tricky to use, because an address tells you nothing about
3045-425: Is rarely a problem. Systems may also differ in other details, such as memory arrangement, operating systems, or peripheral devices . Because a program normally relies on such factors, different systems will typically not run the same machine code, even when the same type of processor is used. A processor's instruction set may have fixed-length or variable-length instructions. How the patterns are organized varies with
3132-518: Is stored – to the application, all resources are equally available and easy to use. The system reserves resource IDs in a certain range to help avoid resource conflicts arising from this. Resource Manager APIs allow the programmer to manipulate the stack and modify the search behaviour. As the resource fork can be edited with a resource editor such as ResEdit , it can be used to localize and customize software . In addition, most resource editors allow visual editing of data. In macOS , it
3219-405: Is the Resource Manager. In addition to abstracting the details of the data storage from the data, the Resource Manager also arranges sets of open resource forks into a stack, with the most recently opened file on top. When trying to load a resource, it will look in the top of the stack first, (perhaps the current document's resource fork), then the next one down (the application's resource fork), then
3306-468: Is typically set to a hard coded value when the CPU is first powered on, and will hence execute whatever machine code happens to be at this address. Similarly, the program counter can be set to execute whatever machine code is at some arbitrary address, even if this is not valid machine code. This will typically trigger an architecture specific protection fault. The CPU is oftentimes told, by page permissions in
3393-401: Is used on Microsoft Windows for instance, and similar solutions are used with the X Window System , although the resources are often left as a separate file. The Windows NT NTFS can support forks (and so can be a file server for Mac files), the native feature providing that support is called an alternate data stream . Windows operating system features (such as the standard Summary tab in
3480-426: Is usually more efficient, because there is a space cost for the references and dynamic allocation metadata, and a time cost associated with dereferencing a reference and with allocating the memory for the smaller objects. Internal storage also enhances locality of reference by keeping different parts of the same large object close together in memory. However, there are a variety of situations in which external storage
3567-967: The AppleSingle and AppleDouble formats . Starting with Mac OS X Tiger , AppleDouble was used to store resource forks on file systems such as Windows SMB shares and FAT32 ( File Allocation Table ) volumes. In the HFS Plus file system, settings can be made to allow other forks in addition to the data and resource forks, to create a "multi-fork" application. As of August 7, 2002, Apple recommended that developers should not build resources into resource forks in Mach-O binaries on Mac OS X. Each resource has an OSType identifier (a four byte value), an ID (a signed 16-bit word ), and an optional name. There are standardized resource types for dialog boxes ( DITL ), images ( PICT ), sounds ( snd ) – and executable binaries ( CODE ) which, until
Resource fork - Misplaced Pages Continue
3654-575: The IA-32 instruction set; and the PowerPC 615 microprocessor, which can natively process both PowerPC and x86 instruction sets. Machine code is a strictly numerical language, and it is the lowest-level interface to the CPU intended for a programmer. Assembly language provides a direct map between the numerical machine code and a human-readable mnemonic. In assembly, numerical opcodes and operands are replaced with mnemonics and labels. For example,
3741-539: The Kruskal count , sometimes possible through opcode-level programming to deliberately arrange the resulting code so that two code paths share a common fragment of opcode sequences. These are called overlapping instructions , overlapping opcodes , overlapping code , overlapped code , instruction scission , or jump into the middle of an instruction . In the 1970s and 1980s, overlapping instructions were sometimes used to preserve memory space. One example were in
3828-599: The Zilog Z80 processor, the machine code 00000101 , which causes the CPU to decrement the B general-purpose register , would be represented in assembly language as DEC B . The IBM 704, 709, 704x and 709x store one instruction in each instruction word; IBM numbers the bit from the left as S, 1, ..., 35. Most instructions have one of two formats: For all but the IBM 7094 and 7094 II, there are three index registers designated A, B and C; indexing with multiple 1 bits in
3915-506: The polymorphic type α ref , where α is to be replaced with the type of value pointed to. These mutable references can be pointed to different objects over their lifetime. For example, this permits building of circular data structures. The reference cell is functionally equivalent to a mutable array of length 1. To preserve safety and efficient implementations, references cannot be type-cast in ML, nor can pointer arithmetic be performed. In
4002-416: The x86 architecture has available the 0x90 opcode; it is represented as NOP in the assembly source code . While it is possible to write programs directly in machine code, managing individual bits and calculating numerical addresses is tedious and error-prone. Therefore, programs are rarely written directly in machine code. However, an existing machine code program may be edited if the assembly source code
4089-558: The CPU to perform a specific task. Examples of such tasks include: In general, each architecture family (e.g., x86 , ARM ) has its own instruction set architecture (ISA), and hence its own specific machine code language. There are exceptions, such as the VAX architecture, which includes optional support of the PDP-11 instruction set; the IA-64 architecture, which includes optional support of
4176-569: The Properties page for non-Office files) and Windows applications use them and Microsoft was developing a next-generation file system that has this sort of feature as basis. Early versions of the BeOS implemented a database within the file system, which could be used in a manner analogous to a resource fork. Performance issues led to a change in later releases to a system of complex file system attributes. Under this system resources were handled in
4263-403: The ability to circumvent these safety mechanisms for compatibility. Fortran does not have an explicit representation of references, but does use them implicitly in its call-by-reference calling semantics. A Fortran reference is best thought of as an alias of another object, such as a scalar variable or a row or column of an array. There is no syntax to dereference the reference or manipulate
4350-435: The absence of pointer arithmetic . The mechanism of references, if varying in implementation, is a fundamental programming language feature common to nearly all modern programming languages. Even some languages that support no direct use of references have some internal or implicit use. For example, the call by reference calling convention can be implemented with either explicit or implicit use of references. Pointers are
4437-402: The advent of the PowerPC processor , were without exception stored in the resource fork. Subroutines for rendering windows are stored in their own type of resources ( WDEF ), and subroutines for rendering menus in theirs ( MDEF ). This arrangement enabled users to easily customize not only individual applications but also the operating system itself, using tools such as ResEdit to modify
SECTION 50
#17327802278824524-561: The clipboard, and much more. Types must be 4 bytes long, so types like snd and STR actually have a space (0x20) at the end. The complexity of programming with resource forks has led to compatibility problems when accessing other file systems via file sharing protocols such as AFP , SMB , NFS and FTP , when storing to non-HFS volumes, or when transmitting files to other systems in other ways (such as via email). The AFP protocol natively supports Resource Forks, and so resource forks are typically transmitted to these volumes as-is, and stored by
4611-459: The contents of the referent directly. Fortran references can be null. As in other languages, these references facilitate the processing of dynamic structures, such as linked lists, queues, and trees. A number of object-oriented languages such as Eiffel , Java , C# , and Visual Basic have adopted a much more opaque type of reference, usually referred to as simply a reference . These references have types like C pointers indicating how to interpret
4698-477: The data fork is written as one file, and the resource fork and metadata are written as an entirely separate file preceded by a "._" naming convention. For example: ExampleFile.psd would contain the data fork, and ._ExampleFile.psd would contain the resource fork and metadata. Compatibility problems can arise because macOS will handle storage of resource forks differently, depending on macOS version, settings, and file system type. For example, on an SMB network with
4785-457: The data it refers to is not misinterpreted. However, because C has a weak type system which can be violated using casts (explicit conversions between various pointer types and between pointer types and integers), misinterpretation is still possible, if more difficult. Its successor C++ tried to increase type safety of pointers with new cast operators, a reference type & , and smart pointers in its standard library , but still retained
4872-646: The data they reference, but they are typesafe in that they cannot be interpreted as a raw address and unsafe conversions are not permitted. References are extensively used to access and assign objects. References are also used in function/ method calls or message passing, and reference counts are frequently used to perform garbage collection of unused objects. In Standard ML , OCaml , and many other functional languages, most values are persistent: they cannot be modified by assignment. Assignable "reference cells" provide mutable variables , data that can be modified. Such reference cells can hold any value, and so are given
4959-487: The data through it, and the data itself need not be moved. They also make sharing of data between different code areas easier; each keeps a reference to it. References can cause significant complexity in a program, partially due to the possibility of dangling and wild references and partially because the topology of data with references is a directed graph , whose analysis can be quite complicated. Nonetheless, references are still simpler to analyze than pointers due to
5046-521: The defined IDs and names. The resource fork can be thought of as consisting of essentially two objects, the resource map and the resource data itself, but in fact each data type is a hierarchical structure which stores multiple items of data. The format in which the information in the resource data is stored is defined based on the types of information, which are known as "resource types." Resource data often makes references to other types of data. In macOS, forks are named file /..namedfork/ forkname , e.g. ,
5133-409: The file itself, as when requesting a lock on the file, and a specific position within the file's content, as when reading a file. In distributed computing , the reference may contain more than an address or identifier; it may also include an embedded specification of the network protocols used to locate and access the referenced object, the way information is encoded or serialized. Thus, for example,
5220-529: The forks may be stored in special ways, such as specially named files, special directories, or even Alternate Data Streams. Another challenge is preserving resource forks when transmitting files using non-resource fork-aware applications or with certain transfer methods, including email and FTP. A number of file formats, such as MacBinary and BinHex , have been created to handle this. Command-line system tools SplitForks and FixupResourceForks allow manual flattening and merging of resource forks. In addition,
5307-540: The functional paradigm, many structures that would be represented using pointers in a language like C are represented using other facilities, such as the powerful algebraic datatype mechanism. The programmer is then able to enjoy certain properties (such as the guarantee of immutability) while programming, even though the compiler often uses machine pointers "under the hood". Perl supports hard references, which function similarly to those in other languages, and symbolic references , which are just string values that contain
SECTION 60
#17327802278825394-591: The icon allows the user to see and modify the metadata present in the .info file. .info files can be seen as individual files in the command-line interface or a File manager . Modern AmigaOS clones ( AROS , MorphOS and AOS4 ) inherit the structure (complete with metadata) of the .info files of older AmigaOS versions, and can also accept standard PNG graphic files as icon bitmaps in their .info files. NeXT operating systems NeXTSTEP and OPENSTEP , their successor, macOS , and other systems like RISC OS implemented another solution. Under these systems
5481-469: The implementation of error tables in Microsoft 's Altair BASIC , where interleaved instructions mutually shared their instruction bytes. The technique is rarely used today, but might still be necessary to resort to in areas where extreme optimization for size is necessary on byte-level such as in the implementation of boot loaders which have to fit into boot sectors . It is also sometimes used as
5568-448: The local machine may gain access to data that is replicated or exists only as a weakly consistent message stream. In all these cases, the reference includes the full set of instructions, or a recipe, for how to access the data; in this sense, it serves the same purpose as an identifier or address in memory. If we have a set of keys K and a set of data objects D , any well-defined (single-valued) function from K to D ∪ { null } defines
5655-526: The machine code of the architecture is implemented by an even more fundamental underlying layer called microcode , providing a common machine language interface across a line or family of different models of computer with widely different underlying dataflows . This is done to facilitate porting of machine language programs between different models. An example of this use is the IBM System/360 family of computers and their successors. Machine code
5742-426: The machine code to have information about the source code encoded within. The information includes a symbol table that contains debug symbols . The symbol table may be stored within the executable, or it may exist in separate files. A debugger can then read the symbol table to help the programmer interactively debug the machine code in execution . Reference (computer science) In computer programming ,
5829-455: The most primitive type of reference. Due to their intimate relationship with the underlying hardware, they are one of the most powerful and efficient types of references. However, also due to this relationship, pointers require a strong understanding by the programmer of the details of memory architecture. Because pointers store a memory location's address, instead of a value directly, inappropriate use of pointers can lead to undefined behavior in
5916-429: The next one (system resource forks). This arrangement is very powerful – it permits local resources to override more global ones lower down – so an application can provide its own icons or fonts in place of the standard system ones, for example. It also allows an application to load resources from the system using the same API as any other resource, without regard to where or how that resource
6003-412: The other four index registers. The effective address is normally Y-C(T), where C(T) is either 0 for a tag of 0, the logical or of the selected index regisrs in multiple tag mode or the selected index register if not in multiple tag mode. However, the effective address for index register control instructions is just Y. A flag with both bits 1 selects indirect addressing; the indirect address word has both
6090-529: The particular architecture and type of instruction. Most instructions have one or more opcode fields that specify the basic instruction type (such as arithmetic, logical, jump , etc.), the operation (such as add or compare), and other fields that may give the type of the operand (s), the addressing mode (s), the addressing offset(s) or index, or the operand value itself (such constant operands contained in an instruction are called immediate ). Not all machines or individual instructions have explicit operands. On
6177-657: The point of view of a process , the code space is the part of its address space where the code in execution is stored. In multitasking systems this comprises the program's code segment and usually shared libraries . In multi-threading environment, different threads of one process share code space along with data space, which reduces the overhead of context switching considerably as compared to process switching. Various tools and methods exist to decode machine code back to its corresponding source code . Machine code can easily be decoded back to its corresponding assembly language source code because assembly language forms
6264-504: The point of view of the CPU, machine code is stored in RAM, but is typically also kept in a set of caches for performance reasons. There may be different caches for instructions and data, depending on the architecture. The CPU knows what machine code to execute, based on its internal program counter. The program counter points to a memory address and is changed based on special instructions which may cause programmatic branches. The program counter
6351-512: The project (since there is no application binding in AmigaOS), special project options and any user comments. .info files are invisible on the Amiga's desktop ( Workbench ). The icon on the desktop, taken from the .info itself, is the interface metaphor through which the user interacts both with the project itself and its associated .info file. A dialog box accessible by right-clicking
6438-553: The raw resource fork; however, they should be used only for applications such as copying a file – Apple strongly warns against using the resource fork as a "second data fork." From the POSIX interface, the resource fork could be accessed as filename /..namedfork/rsrc or as filename /rsrc ; the shorter form was deprecated in Mac OS X v10.4 and removed completely in Mac OS X v10.7 . The smallest elements making up
6525-412: The registers 1 and 2 and placing the result in register 6 is encoded: Load a value into register 8, taken from the memory cell 68 cells after the location listed in register 3: Jumping to the address 1024: On processor architectures with variable-length instruction sets (such as Intel 's x86 processor family) it is, within the limits of the control-flow resynchronizing phenomenon known as
6612-423: The resource fork of the file IMG_0593.jpg is IMG_0593.jpg/..namedfork/rsrc. The ls command supports a -l@ option which lists a file's forks. Resource forks appear as the extended attribute com.apple.ResourceFork. Previously resource forks were accessed via the 'Resource Manager' API . This API is now deprecated. Under the deprecated API: File Manager APIs such as PBOpenRF() also allowed access to
6699-468: The resource map and other implementation details are big-endian , the Resource Manager by itself does not have any knowledge of the contents of a generic resource, and so cannot perform the byte swapping automatically.) Until the advent of Mac OS X v10.4 , the standard UNIX command-line utilities in macOS (such as cp and mv ) did not respect resource forks. To copy files with resource forks, one had to use ditto or CpMac and MvMac. The concept of
6786-406: The resources are left in an original format, for instance, pictures are included as complete TIFF files instead of being encoded into some sort of container. These resources are then placed in a directory along with the executable code and "raw data". The directory (called a " bundle " or " application directory ") is then presented to the user as the application itself. This solution provides all of
6873-406: The resources of an application file or any of the system files. Within an application or other code, resources can be loaded simply using a combination of their type, ID or name, without regard to how and where they are stored in the resource fork. The client is returned a handle to the loaded resource which can then be accessed like any other heap-based data. The OS component that facilitates this
6960-416: The result of a constant expression freed up by replacing it by that constant) and other code enhancements. A much more human-friendly rendition of machine language, named assembly language , uses mnemonic codes to refer to machine code instructions, rather than using the instructions' numeric values directly, and uses symbolic names to refer to storage locations and sometimes registers . For example, on
7047-439: The same architecture . Successor or derivative processor designs often include instructions of a predecessor and may add new additional instructions. Occasionally, a successor design will discontinue or alter the meaning of some instruction code (typically because it is needed for new purposes), affecting code compatibility to some extent; even compatible processors may show slightly different behavior for some instructions, but this
7134-420: The same functionality as the resource fork, but allows the resources to be easily manipulated by any application – a "resource editor" (like ResEdit ) is not needed. From the command-line interface, the bundle appears to be a normal directory. This approach was not an option on the classic Mac OS , since the file system ( MFS ) did not support separate catalog directories. When catalog file support
7221-449: The server transparently to clients. The SMB protocol supports a file metadata system similar to Macintosh forks known as Alternate Data Streams (ADSes hereafter). macOS did not support storing resource forks in ADSes on SMB volumes by default until Mac OS X v10.6 . In previous versions of the OS, including upgraded versions of 10.6, this feature can be enabled with a param change or by creating
7308-443: The tag subtracts the logical or of the selected index registers and loading with multiple 1 bits in the tag loads all of the selected index registers. The 7094 and 7094 II have seven index registers, but when they are powered on they are in multiple tag mode , in which they use only the three of the index registers in a fashion compatible with earlier machines, and require a Leave Multiple Tag Mode ( LMTM ) instruction in order to access
7395-491: The value it points to, not even how large it is or how to interpret it; such information is encoded in the program logic. The result is that misinterpretations can occur in incorrect programs, causing bewildering errors. One of the earliest opaque references was that of the Lisp language cons cell , which is simply a record containing two references to other Lisp objects, including possibly other cons cells. This simple structure
7482-406: The x86 architecture writes values into four implicit destination registers. This distinction between explicit and implicit operands is important in code generators, especially in the register allocation and live range tracking parts. A good code optimizer can track implicit and explicit operands which may allow more frequent constant propagation , constant folding of registers (a register assigned
7569-509: Was included in Mac OS, with the HFS filesystem, the resource fork was retained. macOS does retain the classic Resource Manager API as part of its Carbon libraries for backward compatibility. However, the resources themselves can now be stored in separate data files within the file system – the Resource Manager now hides this implementation change from the client code. Machine code In computer programming , machine code
#881118