<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: attr code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Mon, 06 Oct 2008 05:20:34 GMT</pubDate>
    <description>DZone Snippets: attr code</description>
    <item>
      <title>Get file attributes</title>
      <link>http://snippets.dzone.com/posts/show/1265</link>
      <description>&lt;code&gt;&lt;br /&gt;    attr: func [&lt;br /&gt;        {Return current attributes for the file.}&lt;br /&gt;        file [file!]&lt;br /&gt;        /with   {Retrieve only selected attributes.}&lt;br /&gt;            sel {Selected attributes to retrieve.}&lt;br /&gt;        /avail  {Return a list of attributes available for the file.}&lt;br /&gt;        /copy   {Copy all attributes, which are safe to copy, to f2.}&lt;br /&gt;            f2 [file!]&lt;br /&gt;        /local a&lt;br /&gt;    ][&lt;br /&gt;        if with  [return get-modes file sel]&lt;br /&gt;        if avail [return get-modes file 'file-modes]&lt;br /&gt;        if copy  [&lt;br /&gt;            ;set-modes f2 a: get-modes file get-modes file 'copy-modes&lt;br /&gt;            ; Core 2.5 includes full-path, which it shouldn't&lt;br /&gt;            ;set-modes f2 a: get-modes file exclude get-modes file 'copy-modes [full-path]&lt;br /&gt;            set-modes f2 a: get-modes file get-modes file 'copy-modes&lt;br /&gt;            return a&lt;br /&gt;        ]&lt;br /&gt;        get-modes file get-modes file 'file-modes&lt;br /&gt;    ]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 23 Jan 2006 01:53:50 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/1265</guid>
      <author>gregg.irwin (Gregg Irwin)</author>
    </item>
  </channel>
</rss>
