# `hcount`

_Size of a file in bytes_
```syntax
hcount x     hcount[x]
```

Where `x` is a [file symbol](glossary.md#file-symbol) atom,
returns the size of the file in bytes as a long.
```q
q)`:test.txt 0: ("hello";"world")
`:test.txt
q)hcount`:test.txt
12
```

On a compressed or encrypted file, `hcount` returns the size of the original uncompressed or unencrypted file.
```q
q)(`:cmp;17;2;6) set til 1000
`:cmp
q)hcount`:cmp
8016
q)(-21!`:cmp)`compressedLength
1611
```

`hcount` signals an error if the file doesn't exist or `x` is a directory.
```q
q)hcount`:nosuch
'nosuch. OS reports: No such file or directory
  [0]  hcount`:nosuch
       ^
```

----

[File system](files.md)


[File compression](../how_to/interact_with_databases/file-compression.md)


[Data at rest encryption (DARE)](../how_to/interact_with_databases/dare.md)
