---
name: "libfshfs"
section: "3"
platform: "linux"
package: "libfshfs-dev"
version: "20240501-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/libfshfs"
---

# libfshfs(3)

Library to access the Hierarchical File System (HFS) format

## NAME

**libfshfs.h** – Library to access the Hierarchical File System (HFS) format

## SYNOPSIS

**#include \<libfshfs.h\>**

Support functions

*const* *char* *\**\

**libfshfs\_get\_version**(*void*);

*int*\

**libfshfs\_get\_access\_flags\_read**(*void*);

*int*\

**libfshfs\_get\_codepage**(*int \*codepage*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_set\_codepage**(*int codepage*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_check\_volume\_signature**(*const char \*filename*, *libfshfs\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libfshfs\_check\_volume\_signature\_wide**(*const wchar\_t \*filename*, *libfshfs\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libfshfs\_check\_volume\_signature\_file\_io\_handle**(*libbfio\_handle\_t \*file\_io\_handle*, *libfshfs\_error\_t \*\*error*);

Notify functions

*void*\

**libfshfs\_notify\_set\_verbose**(*int verbose*);

*int*\

**libfshfs\_notify\_set\_stream**(*FILE \*stream*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_notify\_stream\_open**(*const char \*filename*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_notify\_stream\_close**(*libfshfs\_error\_t \*\*error*);

Error functions

*void*\

**libfshfs\_error\_free**(*libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_error\_fprint**(*libfshfs\_error\_t \*error*, *FILE \*stream*);

*int*\

**libfshfs\_error\_sprint**(*libfshfs\_error\_t \*error*, *char \*string*, *size\_t size*);

*int*\

**libfshfs\_error\_backtrace\_fprint**(*libfshfs\_error\_t \*error*, *FILE \*stream*);

*int*\

**libfshfs\_error\_backtrace\_sprint**(*libfshfs\_error\_t \*error*, *char \*string*, *size\_t size*);

Volume functions

*int*\

**libfshfs\_volume\_initialize**(*libfshfs\_volume\_t \*\*volume*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_free**(*libfshfs\_volume\_t \*\*volume*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_signal\_abort**(*libfshfs\_volume\_t \*volume*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_open**(*libfshfs\_volume\_t \*volume*, *const char \*filename*, *int access\_flags*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_close**(*libfshfs\_volume\_t \*volume*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_utf8\_name\_size**(*libfshfs\_volume\_t \*volume*, *size\_t \*utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_utf8\_name**(*libfshfs\_volume\_t \*volume*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_utf16\_name\_size**(*libfshfs\_volume\_t \*volume*, *size\_t \*utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_utf16\_name**(*libfshfs\_volume\_t \*volume*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_root\_directory**(*libfshfs\_volume\_t \*volume*, *libfshfs\_file\_entry\_t \*\*file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_file\_entry\_by\_identifier**(*libfshfs\_volume\_t \*volume*, *uint32\_t identifier*, *libfshfs\_file\_entry\_t \*\*file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_file\_entry\_by\_utf8\_path**(*libfshfs\_volume\_t \*volume*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfshfs\_file\_entry\_t \*\*file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_volume\_get\_file\_entry\_by\_utf16\_path**(*libfshfs\_volume\_t \*volume*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfshfs\_file\_entry\_t \*\*file\_entry*, *libfshfs\_error\_t \*\*error*);

Available when compiled with wide character string support:

*int*\

**libfshfs\_volume\_open\_wide**(*libfshfs\_volume\_t \*volume*, *const wchar\_t \*filename*, *int access\_flags*, *libfshfs\_error\_t \*\*error*);

Available when compiled with libbfio support:

*int*\

**libfshfs\_volume\_open\_file\_io\_handle**(*libfshfs\_volume\_t \*volume*, *libbfio\_handle\_t \*file\_io\_handle*, *int access\_flags*, *libfshfs\_error\_t \*\*error*);

File entry functions

*int*\

**libfshfs\_file\_entry\_free**(*libfshfs\_file\_entry\_t \*\*file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_parent\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*parent\_identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_parent\_file\_entry**(*libfshfs\_file\_entry\_t \*file\_entry*, *libfshfs\_file\_entry\_t \*\*parent\_file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_link\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*link\_identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_creation\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*hfs\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_modification\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*hfs\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_entry\_modification\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*hfs\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_access\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*hfs\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_backup\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*hfs\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_added\_time**(*libfshfs\_file\_entry\_t \*file\_entry*, *int32\_t \*posix\_time*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_file\_mode**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*file\_mode*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_number\_of\_links**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*number\_of\_links*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_owner\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*owner\_identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_group\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*group\_identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_device\_identifier**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*device\_identifier*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_device\_number**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint32\_t \*major\_device\_number*, *uint32\_t \*minor\_device\_number*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf8\_name\_size**(*libfshfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf8\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf16\_name\_size**(*libfshfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf16\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf8\_symbolic\_link\_target\_size**(*libfshfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf8\_symbolic\_link\_target**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf16\_symbolic\_link\_target\_size**(*libfshfs\_file\_entry\_t \*file\_entry*, *size\_t \*utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_utf16\_symbolic\_link\_target**(*libfshfs\_file\_entry\_t \*file\_entry*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_has\_resource\_fork**(*libfshfs\_file\_entry\_t \*file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_resource\_fork**(*libfshfs\_file\_entry\_t \*file\_entry*, *libfshfs\_data\_stream\_t \*\*data\_stream*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_number\_of\_extended\_attributes**(*libfshfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_extended\_attributes*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_extended\_attribute\_by\_index**(*libfshfs\_file\_entry\_t \*file\_entry*, *int extended\_attribute\_index*, *libfshfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_has\_extended\_attribute\_by\_utf8\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_has\_extended\_attribute\_by\_utf16\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_extended\_attribute\_by\_utf8\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfshfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_extended\_attribute\_by\_utf16\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfshfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_number\_of\_sub\_file\_entries**(*libfshfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_sub\_file\_entries*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_sub\_file\_entry\_by\_index**(*libfshfs\_file\_entry\_t \*file\_entry*, *int sub\_file\_entry\_index*, *libfshfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_sub\_file\_entry\_by\_utf8\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint8\_t \*utf8\_string*, *size\_t utf8\_string\_length*, *libfshfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_sub\_file\_entry\_by\_utf16\_name**(*libfshfs\_file\_entry\_t \*file\_entry*, *const uint16\_t \*utf16\_string*, *size\_t utf16\_string\_length*, *libfshfs\_file\_entry\_t \*\*sub\_file\_entry*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_file\_entry\_read\_buffer**(*libfshfs\_file\_entry\_t \*file\_entry*, *void \*buffer*, *size\_t buffer\_size*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_file\_entry\_read\_buffer\_at\_offset**(*libfshfs\_file\_entry\_t \*file\_entry*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libfshfs\_error\_t \*\*error*);

*off64\_t*\

**libfshfs\_file\_entry\_seek\_offset**(*libfshfs\_file\_entry\_t \*file\_entry*, *off64\_t offset*, *int whence*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_offset**(*libfshfs\_file\_entry\_t \*file\_entry*, *off64\_t \*offset*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_size**(*libfshfs\_file\_entry\_t \*file\_entry*, *size64\_t \*size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_number\_of\_extents**(*libfshfs\_file\_entry\_t \*file\_entry*, *int \*number\_of\_extents*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_file\_entry\_get\_extent\_by\_index**(*libfshfs\_file\_entry\_t \*file\_entry*, *int extent\_index*, *off64\_t \*extent\_offset*, *size64\_t \*extent\_size*, *uint32\_t \*extent\_flags*, *libfshfs\_error\_t \*\*error*);

Data stream functions

*int*\

**libfshfs\_data\_stream\_free**(*libfshfs\_data\_stream\_t \*\*data\_stream*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_data\_stream\_read\_buffer**(*libfshfs\_data\_stream\_t \*data\_stream*, *void \*buffer*, *size\_t buffer\_size*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_data\_stream\_read\_buffer\_at\_offset**(*libfshfs\_data\_stream\_t \*data\_stream*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libfshfs\_error\_t \*\*error*);

*off64\_t*\

**libfshfs\_data\_stream\_seek\_offset**(*libfshfs\_data\_stream\_t \*data\_stream*, *off64\_t offset*, *int whence*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_data\_stream\_get\_offset**(*libfshfs\_data\_stream\_t \*data\_stream*, *off64\_t \*offset*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_data\_stream\_get\_size**(*libfshfs\_data\_stream\_t \*data\_stream*, *size64\_t \*size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_data\_stream\_get\_number\_of\_extents**(*libfshfs\_data\_stream\_t \*data\_stream*, *int \*number\_of\_extents*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_data\_stream\_get\_extent\_by\_index**(*libfshfs\_data\_stream\_t \*data\_stream*, *int extent\_index*, *off64\_t \*extent\_offset*, *size64\_t \*extent\_size*, *uint32\_t \*extent\_flags*, *libfshfs\_error\_t \*\*error*);

Extended attribute functions

*int*\

**libfshfs\_extended\_attribute\_free**(*libfshfs\_extended\_attribute\_t \*\*extended\_attribute*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_utf8\_name\_size**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *size\_t \*utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_utf8\_name**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *uint8\_t \*utf8\_string*, *size\_t utf8\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_utf16\_name\_size**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *size\_t \*utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_utf16\_name**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *uint16\_t \*utf16\_string*, *size\_t utf16\_string\_size*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_extended\_attribute\_read\_buffer**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *void \*buffer*, *size\_t buffer\_size*, *libfshfs\_error\_t \*\*error*);

*ssize\_t*\

**libfshfs\_extended\_attribute\_read\_buffer\_at\_offset**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *void \*buffer*, *size\_t buffer\_size*, *off64\_t offset*, *libfshfs\_error\_t \*\*error*);

*off64\_t*\

**libfshfs\_extended\_attribute\_seek\_offset**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *off64\_t offset*, *int whence*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_offset**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *off64\_t \*offset*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_size**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *size64\_t \*size*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_number\_of\_extents**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *int \*number\_of\_extents*, *libfshfs\_error\_t \*\*error*);

*int*\

**libfshfs\_extended\_attribute\_get\_extent\_by\_index**(*libfshfs\_extended\_attribute\_t \*extended\_attribute*, *int extent\_index*, *off64\_t \*extent\_offset*, *size64\_t \*extent\_size*, *uint32\_t \*extent\_flags*, *libfshfs\_error\_t \*\*error*);

## DESCRIPTION

The **libfshfs\_get\_version**() function is used to retrieve the library version.

## RETURN VALUES

Most of the functions return NULL or -1 on error, dependent on the return type. For the actual return values see "libfshfs.h".

## ENVIRONMENT

None

## FILES

None

## NOTES

libfshfs can be compiled with wide character support (wchar\_t).

To compile libfshfs with wide character support use: *./configure* *--enable-wide-character-type=yes*\
  or define: *\_UNICODE*\
  or *UNICODE*\
  during compilation.

*LIBFSHFS\_WIDE\_CHARACTER\_TYPE*\
  in libfshfs/features.h can be used to determine if libfshfs was compiled with wide character support.

## BUGS

Please report bugs of any kind on the project issue tracker: https://github.com/libyal/libfshfs/issues

## AUTHOR

These man pages are generated from "libfshfs.h".

## COPYRIGHT

Copyright (C) 2009-2024, Joachim Metz \<joachim.metz@gmail.com\>.

This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## SEE ALSO

the libfshfs.h include file
