<doc>
  <legacy_id>1836</legacy_id>
  <name>resfile</name>
  <type>keyword</type>
  <syntax>
  </syntax>
  <library></library>
  <objects>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Files, Folders, &amp; Resources</category>
  </classification>
  <references>
    <function tag="setResource">setResource Function</function>
    <command tag="revCopyFile">revCopyFile Command</command>
    <keyword tag="file">file Keyword</keyword>
  </references>
  <history>
    <introduced version="1.0">Added.</introduced>
  </history>
  <platforms>
    <mac/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
  </classes>
  <security>
  </security>
  <summary>Used as a URL type with such commands as <command tag="load">load</command> and <command tag="get">get</command> to designate the resource fork of a Mac OS file.</summary>
  <examples>
    <example>get URL "resfile:/Disk/System Folder/Apple Menu Items/Calculator App"</example>
  </examples>
  <description>
    <p>Use the <b>resfile</b> <glossary tag="keyword">keyword</glossary> to work with <glossary tag="Mac OS">Mac OS</glossary> <glossary tag="resource fork">resource forks</glossary>.</p><p/><p><b>Comments:</b></p><p>On Mac OS systems, files consist of either or both of a data fork and a resource fork. The resource fork contains defined resources such as icons, menu definitions, dialog boxes, fonts, and so forth.</p><p/><p>A URL container can be used anywhere another container type is used. The LiveCode-specific scheme "resfile" indicates the resource fork of a file which is located on the user's system. The file is specified by either an absolute path starting with "/", or a relative path from the <b>defaultFolder</b>.</p><p/><p>A <b>resfile</b> <keyword tag="URL">URL</keyword> specifies the entire <glossary tag="resource fork">resource fork</glossary>, not just one <glossary tag="resource">resource</glossary>. The most common use for this <keyword tag="URL">URL</keyword> <glossary tag="URL scheme">scheme</glossary> is to copy an entire <glossary tag="resource fork">resource fork</glossary> from one <keyword tag="file">file</keyword> to another. To modify the data from a <keyword tag="resfile">resfile</keyword> <keyword tag="URL">URL</keyword>, you need to understand the details of Apple's <glossary tag="resource fork">resource fork</glossary> format.</p><p/><p><img src="202653"/> <b>Important!</b> Unlike the <keyword tag="file">file</keyword> and <keyword tag="binfile">binfile</keyword> <keyword tag="URL">URL</keyword> types, the <keyword tag="resfile">resfile</keyword> <glossary tag="keyword">keyword</glossary> cannot be used to create a <keyword tag="file">file</keyword>. If the <keyword tag="file">file</keyword> "myFile" doesn't yet exist, attempting to use it with the <keyword tag="resfile">resfile</keyword> <glossary tag="keyword">keyword</glossary> will fail and the <function tag="result">result</function> <control_st tag="function">function</control_st> will be set to "file not found". To create a new resource file, first use a <keyword tag="file">file</keyword> <keyword tag="URL">URL</keyword> to create the <keyword tag="file">file</keyword> with an empty <glossary tag="data fork">data fork</glossary>, then write the needed data to its <glossary tag="resource fork">resource fork</glossary>:</p><p/><p>  put empty into URL "file:myFile" <i>-- creates an empty file</i></p><p>  put myStoredResources into URL "resfile:myFile"</p>
  </description>
</doc>