doc/classes/RsDos.src/M000524.html in ripxplore-0.14.0 vs doc/classes/RsDos.src/M000524.html in ripxplore-0.14.1

- old
+ new

@@ -3,60 +3,16 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> - <title>files (RsDos)</title> + <title>sectors_per_granule (RsDos)</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" /> </head> <body class="standalone-code"> - <pre><span class="ruby-comment cmt"># File lib/file_systems/RsDos.rb, line 73</span> -<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">files</span>(<span class="ruby-identifier">file_system_image</span>) - <span class="ruby-identifier">files</span>=<span class="ruby-constant">FileContainer</span>.<span class="ruby-identifier">new</span> - <span class="ruby-identifier">granule_allocation_table</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">directory_track</span>,<span class="ruby-value">2</span>) - <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">files</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">granule_allocation_table</span>.<span class="ruby-identifier">nil?</span> -<span class="ruby-comment cmt"># file_system_image.volume_name=&quot;RSDOS Disk&quot;</span> - (<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">sectors_in_track</span>(<span class="ruby-identifier">directory_track</span>)<span class="ruby-operator">-</span>[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>,<span class="ruby-value">12</span>,<span class="ruby-value">13</span>,<span class="ruby-value">14</span>,<span class="ruby-value">15</span>,<span class="ruby-value">16</span>,<span class="ruby-value">17</span>,<span class="ruby-value">18</span>]).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sector_no</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">fde_sector</span>=<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">directory_track</span>,<span class="ruby-identifier">sector_no</span>) - (<span class="ruby-identifier">fde_sector</span>.<span class="ruby-identifier">length</span><span class="ruby-operator">/</span><span class="ruby-constant">FDE_SIZE</span>).<span class="ruby-identifier">times</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">fde_number</span><span class="ruby-operator">|</span> - <span class="ruby-identifier">fde</span>=<span class="ruby-identifier">fde_sector</span>[<span class="ruby-identifier">fde_number</span><span class="ruby-operator">*</span><span class="ruby-constant">FDE_SIZE</span>,<span class="ruby-constant">FDE_SIZE</span>] - <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fde</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">==</span><span class="ruby-value">0</span> - <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fde</span>[<span class="ruby-value">0</span>]<span class="ruby-operator">==</span><span class="ruby-value">0xff</span> - - <span class="ruby-identifier">filename_base</span>=<span class="ruby-identifier">fde</span>[<span class="ruby-value">0</span>,<span class="ruby-value">8</span>].<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;A8&quot;</span>) - <span class="ruby-identifier">filename_extension</span>=<span class="ruby-identifier">fde</span>[<span class="ruby-value">8</span>,<span class="ruby-value">3</span>].<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;A8&quot;</span>) - <span class="ruby-identifier">filename</span>=<span class="ruby-node">&quot;#{filename_base}/#{filename_extension}&quot;</span> - <span class="ruby-identifier">file_type</span>, <span class="ruby-identifier">ascii_flag</span>, <span class="ruby-identifier">granule</span>, <span class="ruby-identifier">last_sector_bytes</span> = <span class="ruby-identifier">fde</span>[<span class="ruby-value">11</span>,<span class="ruby-value">5</span>].<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">&quot;CCCS&quot;</span>) - <span class="ruby-identifier">contents</span>=<span class="ruby-value str">&quot;&quot;</span> - <span class="ruby-identifier">granules</span> = [] - -<span class="ruby-comment cmt"># puts &quot;#{filename}: first gran:#{granule} file type #{file_type} ascii flag #{ascii_flag}&quot;</span> - - <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">granule</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">67</span> - <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">granules</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">granule</span>)<span class="ruby-operator">==</span><span class="ruby-keyword kw">true</span> - <span class="ruby-identifier">granules</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">granule</span> - <span class="ruby-identifier">track_no</span> = <span class="ruby-constant">Integer</span>(<span class="ruby-identifier">granule</span><span class="ruby-operator">/</span><span class="ruby-value">2</span>) - (<span class="ruby-identifier">track_no</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">granule</span><span class="ruby-operator">&gt;</span><span class="ruby-value">33</span> - <span class="ruby-identifier">start_sector</span> = (<span class="ruby-identifier">granule</span> <span class="ruby-operator">%</span> <span class="ruby-value">2</span>) <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">10</span> - <span class="ruby-comment cmt">#puts &quot;Start sector: #{start_sector}&quot;</span> - - <span class="ruby-identifier">granule_value</span> = <span class="ruby-identifier">granule_allocation_table</span>[ <span class="ruby-identifier">granule</span> ] - - <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">granule_value</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">68</span> <span class="ruby-keyword kw">then</span> - <span class="ruby-value">9</span>.<span class="ruby-identifier">times</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">contents</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">track_no</span>,<span class="ruby-identifier">start_sector</span><span class="ruby-operator">+</span><span class="ruby-identifier">i</span>)} - <span class="ruby-keyword kw">else</span> - <span class="ruby-identifier">count</span> = (<span class="ruby-identifier">granule_value</span> <span class="ruby-operator">&amp;</span> <span class="ruby-value">0</span><span class="ruby-identifier">b00011111</span>) <span class="ruby-operator">-</span> <span class="ruby-value">1</span> - <span class="ruby-identifier">count</span>.<span class="ruby-identifier">times</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">contents</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">track_no</span>,<span class="ruby-identifier">start_sector</span><span class="ruby-operator">+</span><span class="ruby-identifier">i</span>)} - <span class="ruby-identifier">contents</span><span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">file_system_image</span>.<span class="ruby-identifier">get_sector</span>(<span class="ruby-identifier">track_no</span>,<span class="ruby-identifier">start_sector</span><span class="ruby-operator">+</span><span class="ruby-identifier">count</span>))[<span class="ruby-value">0</span>,<span class="ruby-identifier">last_sector_bytes</span>] - <span class="ruby-keyword kw">end</span> - <span class="ruby-comment cmt">#puts &quot;#{granule} = #{granule_value}&quot;</span> - <span class="ruby-identifier">granule</span> = <span class="ruby-identifier">granule_value</span> - <span class="ruby-keyword kw">end</span> - - <span class="ruby-identifier">files</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-constant">NativeFileType</span>.<span class="ruby-identifier">best_fit</span>(<span class="ruby-identifier">file_system_image</span>,<span class="ruby-identifier">filename</span>,<span class="ruby-identifier">contents</span>,<span class="ruby-identifier">file_type</span>,<span class="ruby-identifier">ascii_flag</span>) - <span class="ruby-keyword kw">end</span> - <span class="ruby-keyword kw">end</span> - <span class="ruby-identifier">files</span> + <pre><span class="ruby-comment cmt"># File lib/file_systems/RsDos.rb, line 39</span> +<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">sectors_per_granule</span>(<span class="ruby-identifier">file_system_image</span>) + <span class="ruby-value">9</span> <span class="ruby-keyword kw">end</span></pre> </body> </html> \ No newline at end of file