# StructStat

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Fields](https://developer.android.com/reference/android/system/StructStat#lfields)\|[Ctors](https://developer.android.com/reference/android/system/StructStat#pubctors)\|[Methods](https://developer.android.com/reference/android/system/StructStat#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/system/StructStat#inhmethods)  

# StructStat

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/system/StructStat "View this page in Kotlin")\|Java

`
public

final

class
StructStat
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|---------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.system.StructStat |

<br />

*** ** * ** ***

File information returned by[Os.fstat](https://developer.android.com/reference/android/system/Os#fstat(java.io.FileDescriptor)),[Os.lstat](https://developer.android.com/reference/android/system/Os#lstat(java.lang.String)), and[Os.stat](https://developer.android.com/reference/android/system/Os#stat(java.lang.String)). Corresponds to C's`struct stat`from`<stat.h>`.

## Summary

|                                                                                                                              ### Fields                                                                                                                              ||
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` public final `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec) | [st_atim](https://developer.android.com/reference/android/system/StructStat#st_atim) StructTimespec with time of last access.                               |
| ` public final long`                                                                                    | [st_atime](https://developer.android.com/reference/android/system/StructStat#st_atime) Seconds part of time of last access.                                 |
| ` public final long`                                                                                    | [st_blksize](https://developer.android.com/reference/android/system/StructStat#st_blksize) A file system-specific preferred I/O block size for this object. |
| ` public final long`                                                                                    | [st_blocks](https://developer.android.com/reference/android/system/StructStat#st_blocks) Number of blocks allocated for this object.                        |
| ` public final `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec) | [st_ctim](https://developer.android.com/reference/android/system/StructStat#st_ctim) StructTimespec with time of last status change.                        |
| ` public final long`                                                                                    | [st_ctime](https://developer.android.com/reference/android/system/StructStat#st_ctime) Seconds part of time of last status change                           |
| ` public final long`                                                                                    | [st_dev](https://developer.android.com/reference/android/system/StructStat#st_dev) Device ID of device containing file.                                     |
| ` public final int`                                                                                     | [st_gid](https://developer.android.com/reference/android/system/StructStat#st_gid) Group ID of file.                                                        |
| ` public final long`                                                                                    | [st_ino](https://developer.android.com/reference/android/system/StructStat#st_ino) File serial number (inode).                                              |
| ` public final int`                                                                                     | [st_mode](https://developer.android.com/reference/android/system/StructStat#st_mode) Mode (permissions) of file.                                            |
| ` public final `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec) | [st_mtim](https://developer.android.com/reference/android/system/StructStat#st_mtim) StructTimespec with time of last modification.                         |
| ` public final long`                                                                                    | [st_mtime](https://developer.android.com/reference/android/system/StructStat#st_mtime) Seconds part of time of last data modification.                      |
| ` public final long`                                                                                    | [st_nlink](https://developer.android.com/reference/android/system/StructStat#st_nlink) Number of hard links to the file.                                    |
| ` public final long`                                                                                    | [st_rdev](https://developer.android.com/reference/android/system/StructStat#st_rdev) Device ID (if file is character or block special).                     |
| ` public final long`                                                                                    | [st_size](https://developer.android.com/reference/android/system/StructStat#st_size) For regular files, the file size in bytes.                             |
| ` public final int`                                                                                     | [st_uid](https://developer.android.com/reference/android/system/StructStat#st_uid) User ID of file.                                                         |

|                                                                                                                                                                                                                                                                                                                                                                                  ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                  ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[StructStat](https://developer.android.com/reference/android/system/StructStat#StructStat(long,%20long,%20int,%20long,%20int,%20int,%20long,%20long,%20android.system.StructTimespec,%20android.system.StructTimespec,%20android.system.StructTimespec,%20long,%20long))`(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, long st_rdev, long st_size, `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec)` st_atim, `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec)` st_mtim, `[StructTimespec](https://developer.android.com/reference/android/system/StructTimespec)` st_ctim, long st_blksize, long st_blocks) ` Constructs an instance with the given field values. |
| ` `[StructStat](https://developer.android.com/reference/android/system/StructStat#StructStat(long,%20long,%20int,%20long,%20int,%20int,%20long,%20long,%20long,%20long,%20long,%20long,%20long))`(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid, long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime, long st_blksize, long st_blocks) ` Constructs an instance with the given field values.                                                                                                                                                                                                                                                                                                                                        |

|                                                                                                   ### Public methods                                                                                                   ||
|-----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/android/system/StructStat#toString())`() ` Returns a string representation of the object. |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Fields

### st_atim

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final StructTimespec st_atim
```

StructTimespec with time of last access.

<br />

### st_atime

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_atime
```

Seconds part of time of last access.

<br />

### st_blksize

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_blksize
```

A file system-specific preferred I/O block size for this object. For some file system types, this may vary from file to file.

<br />

### st_blocks

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_blocks
```

Number of blocks allocated for this object.

<br />

### st_ctim

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final StructTimespec st_ctim
```

StructTimespec with time of last status change.

<br />

### st_ctime

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_ctime
```

Seconds part of time of last status change

<br />

### st_dev

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_dev
```

Device ID of device containing file.

<br />

### st_gid

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int st_gid
```

Group ID of file.

<br />

### st_ino

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_ino
```

File serial number (inode).

<br />

### st_mode

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int st_mode
```

Mode (permissions) of file.

<br />

### st_mtim

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final StructTimespec st_mtim
```

StructTimespec with time of last modification.

<br />

### st_mtime

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_mtime
```

Seconds part of time of last data modification.

<br />

### st_nlink

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_nlink
```

Number of hard links to the file.

<br />

### st_rdev

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_rdev
```

Device ID (if file is character or block special).

<br />

### st_size

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final long st_size
```

For regular files, the file size in bytes. For symbolic links, the length in bytes of the pathname contained in the symbolic link. For a shared memory object, the length in bytes. For a typed memory object, the length in bytes. For other file types, the use of this field is unspecified.

<br />

### st_uid

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public final int st_uid
```

User ID of file.

<br />

## Public constructors

### StructStat

Added in[API level 27](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public StructStat (long st_dev, 
                long st_ino, 
                int st_mode, 
                long st_nlink, 
                int st_uid, 
                int st_gid, 
                long st_rdev, 
                long st_size, 
                StructTimespec st_atim, 
                StructTimespec st_mtim, 
                StructTimespec st_ctim, 
                long st_blksize, 
                long st_blocks)
```

Constructs an instance with the given field values.

<br />

|              Parameters               ||
|--------------|-------------------------|
| `st_dev`     | `long` <br />           |
| `st_ino`     | `long` <br />           |
| `st_mode`    | `int` <br />            |
| `st_nlink`   | `long` <br />           |
| `st_uid`     | `int` <br />            |
| `st_gid`     | `int` <br />            |
| `st_rdev`    | `long` <br />           |
| `st_size`    | `long` <br />           |
| `st_atim`    | `StructTimespec` <br /> |
| `st_mtim`    | `StructTimespec` <br /> |
| `st_ctim`    | `StructTimespec` <br /> |
| `st_blksize` | `long` <br />           |
| `st_blocks`  | `long` <br />           |

### StructStat

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public StructStat (long st_dev, 
                long st_ino, 
                int st_mode, 
                long st_nlink, 
                int st_uid, 
                int st_gid, 
                long st_rdev, 
                long st_size, 
                long st_atime, 
                long st_mtime, 
                long st_ctime, 
                long st_blksize, 
                long st_blocks)
```

Constructs an instance with the given field values.

<br />

|         Parameters          ||
|--------------|---------------|
| `st_dev`     | `long` <br /> |
| `st_ino`     | `long` <br /> |
| `st_mode`    | `int` <br />  |
| `st_nlink`   | `long` <br /> |
| `st_uid`     | `int` <br />  |
| `st_gid`     | `int` <br />  |
| `st_rdev`    | `long` <br /> |
| `st_size`    | `long` <br /> |
| `st_atime`   | `long` <br /> |
| `st_mtime`   | `long` <br /> |
| `st_ctime`   | `long` <br /> |
| `st_blksize` | `long` <br /> |
| `st_blocks`  | `long` <br /> |

## Public methods

### toString

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String toString ()
```

Returns a string representation of the object.

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |