ght"><pre><span></span><code># Get detailed file metadata
file_info = f.info(&quot;document.txt&quot;)
# Returns: {&quot;$TYPE&quot;:&quot;FILE&quot;,&quot;$BYTES&quot;:1024}

# Check if item exists and get type
info = f.info(&quot;unknown.txt&quot;)
if (info[&quot;$TYPE&quot;] == &quot;FILE&quot;) {
    &quot;File exists with &quot; + info[&quot;$BYTES&quot;] + &quot; bytes\n&quot;.echo()
} else if (info[&quot;$TYPE&quot;] == &quot;DIR&quot;) {
    &quot;Directory exists\n&quot;.echo()
} else {
    &quot;I