---
name: "ixp_srv_verifyfile"
section: "3"
platform: "linux"
package: "libixp-dev"
version: "0.6~20121202+hg148-5"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/ixp_srv_verifyfile"
---

# ixp\_srv\_verifyfile(3)

## NAME

ixp\_srv\_walkandclone, ixp\_srv\_readdir, ixp\_srv\_verifyfile, IxpLookupFn

## SYNOPSIS

```
#include <ixp_srvutil.h>
void ixp_srv_walkandclone(Ixp9Req *req, IxpLookupFn lookup);
void ixp_srv_readdir(Ixp9Req *req, IxpLookupFn lookup, void (*dostat)(IxpStat *, IxpFileId *));
bool ixp_srv_verifyfile(IxpFileId *file, IxpLookupFn lookup);
typedef IxpFileId* (*IxpLookupFn)(IxpFileId*, char*);
```

## DESCRIPTION

These convenience functions simplify the writing of basic and static file servers. They use a generic file lookup function to simplify the process of walking, cloning, and returning directory listings. Given the **[IxpFileId(3)](/IxpFileId/3.md)** of a directory and a filename name should return a new IxpFileId (allocated via **[ixp\_srv\_getfile(3)](/ixp_srv_getfile/3.md)**) for the matching directory entry, or null if there is no match. If the passed name is null, *lookup* should return a linked list of IxpFileIds, one for each child directory entry.

ixp\_srv\_walkandclone handles the moderately complex process of walking from a directory entry and cloning fids, and calls **[ixp\_respond(3)](/ixp_respond/3.md)**. It should be called in response to a TWalk request.

ixp\_srv\_readdir should be called to handle read requests on directories. It prepares a stat for each child of the directory, taking into account the requested offset, and calls **[ixp\_respond(3)](/ixp_respond/3.md)**. The *dostat* parameter must be a function which fills the passed **[IxpStat(3)](/IxpStat/3.md)** pointer based on the contents of the passed IxpFileId.

ixp\_srv\_verifyfile returns whether a file still exists in the filesystem, and should be used by filesystems that invalidate files once they have been deleted.

## SEE ALSO

[IxpFileId(3)](/IxpFileId/3.md), ixp\_getfile(3), ixp\_freefile(3)
