Skip to content

hcount

Size of a file in bytes

hcount x     hcount[x]

Where x is a file symbol atom, returns the size of the file in bytes as a long.

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)(`: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)hcount`:nosuch
'nosuch. OS reports: No such file or directory
  [0]  hcount`:nosuch
       ^

File system

File compression

Data at rest encryption (DARE)