# FileInfo
<span class="source-link">[[Source]](src/files/file_info.md#L-0-5)</span>

This contains file system metadata for a path.

A symlink will report information about itself, other than the size which
will be the size of the target. A broken symlink will report as much as it
can and will set the broken flag.


```pony
class val FileInfo
```

## Constructors

### create
<span class="source-link">[[Source]](src/files/file_info.md#L-0-90)</span>


This will raise an error if the FileStat capability isn't available or the
path doesn't exist.


```pony
new val create(
  from: FilePath val)
: FileInfo val^ ?
```
#### Parameters

*   from: [FilePath](files-FilePath.md) val

#### Returns

* [FileInfo](files-FileInfo.md) val^ ?

---

## Public fields

### let filepath: [FilePath](files-FilePath.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-13)</span>



---

### let mode: [FileMode](files-FileMode.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-15)</span>

UNIX-style file mode.



---

### let hard_links: [U32](builtin-U32.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-18)</span>

Number of hardlinks to this `filepath`.



---

### let device: [U64](builtin-U64.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-21)</span>

OS id of the device containing this `filepath`.
Device IDs consist of a major and minor device id,
denoting the type of device and the instance of this type on the system.




---

### let inode: [U64](builtin-U64.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-28)</span>

UNIX specific INODE number of `filepath`. Is 0 on Windows.



---

### let uid: [U32](builtin-U32.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-31)</span>

UNIX-style user ID of the owner of `filepath`.



---

### let gid: [U32](builtin-U32.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-34)</span>

UNIX-style user ID of the owning group of `filepath`.



---

### let size: [USize](builtin-USize.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-37)</span>

Total size of `filepath` in bytes.

In case of a symlink this is the size of the target, not the symlink itself.




---

### let access_time: ([I64](builtin-I64.md) val , [I64](builtin-I64.md) val)
<span class="source-link">[[Source]](src/files/file_info.md#L-0-44)</span>

Time of last access as a tuple of seconds and nanoseconds since the epoch:

```pony
(let a_secs: I64, let a_nanos: I64) = file_info.access_time
```




---

### let modified_time: ([I64](builtin-I64.md) val , [I64](builtin-I64.md) val)
<span class="source-link">[[Source]](src/files/file_info.md#L-0-53)</span>

Time of last modification as tuple of seconds and nanoseconds since the epoch:

```pony
(let m_secs: I64, let m_nanos: I64) = file_info.modified_time
```




---

### let change_time: ([I64](builtin-I64.md) val , [I64](builtin-I64.md) val)
<span class="source-link">[[Source]](src/files/file_info.md#L-0-62)</span>

Time of the last change either the attributes (number of links, owner,
group, file mode, ...) or the content of `filepath`
as a tuple of seconds and nanoseconds since the epoch:

```pony
(let c_secs: I64, let c_nanos: I64) = file_info.change_time
```

On Windows this will be the file creation time.




---

### let file: [Bool](builtin-Bool.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-75)</span>

`true` if `filepath` points to an a regular file.



---

### let directory: [Bool](builtin-Bool.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-78)</span>

`true` if `filepath` points to a directory.



---

### let pipe: [Bool](builtin-Bool.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-81)</span>

`true` if `filepath` points to a named pipe.



---

### let symlink: [Bool](builtin-Bool.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-84)</span>

`true` if `filepath` points to a symbolic link.



---

### let broken: [Bool](builtin-Bool.md) val
<span class="source-link">[[Source]](src/files/file_info.md#L-0-87)</span>

`true` if `filepath` points to a broken symlink.



---

