Contents

stat(_:_:)

Calls the C stat() function.

Declaration

static func stat(_ path: UnsafePointer<CChar>, _ s: inout CInterop.Stat) -> Int32

Parameters

  • path:

    A null-terminated C string representing the file path.

  • s:

    An inout reference to a CInterop.Stat struct to populate.

Return Value

0 on success, -1 on error (check Errno.current).

Discussion

This is a direct wrapper around the C stat() system call. For a more ergonomic Swift API, use Stat instead.