---
name: "gfs_pio_set_view_local"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.4.1-1.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_pio_set_view_local"
---

# gfs\_pio\_set\_view\_local(3)

change file view to the corresponding fragment

## NAME

gfs\_pio\_set\_view\_local - change file view to the corresponding fragment

## SYNOPSIS

**#include \<gfarm/gfarm.h\>**

**char \*gfs\_pio\_set\_view\_local (GFS\_File** *gf***, int** *flags***);**

## DESCRIPTION

**gfs\_pio\_set\_view\_local()** changes the process's view of the data in the file specified by *gf* to a file fragment in the local file view.  The local file view model assumes each process has its own file fragment which is specified by the argument *node* of **[gfs\_pio\_set\_local(3)](/gfs_pio_set_local/3.md)**.

The total number of file fragments is also specified by the argument *nnode* of **[gfs\_pio\_set\_local(3)](/gfs_pio_set_local/3.md)**.  If it is different from the total fragment number of the existent file, it is erroneous.

Before changing to the local file view, it is necessary to call **[gfs\_pio\_set\_local(3)](/gfs_pio_set_local/3.md)** in advance.

Values of *flag* are constructed by a bitwise-inclusive-OR of GFARM\_FILE\_SEQUENTIAL, GFARM\_FILE\_REPLICATE, and GFARM\_FILE\_NOT\_REPLICATE. For details, refer to **[gfs\_pio\_set\_view\_index(3)](/gfs_pio_set_view_index/3.md)**.

By default, Gfarm files are accessed as a whole file in global file view where each fragment can be seamlessly accessed.

## RETURN VALUES

- **NULL**

  The function terminated successfully.

- **GFARM\_ERR\_NO\_MEMORY**

  Insufficient memory was available.

- **GFARM\_ERR\_OPERATION\_NOT\_PERMITTED**

  The file is not a fragmented file.

- **GFARM\_ERR\_FRAGMENT\_NUMBER\_DOES\_NOT\_MATCH**

  The total number of file fragments is different from the existence one.

- **Others**

  An error except the above occurred.  The reason is shown by its pointed strings.

## SEE ALSO

[**gfs\_pio\_create**(3)](/gfs_pio_create/3.md), [**gfs\_pio\_open**(3)](/gfs_pio_open/3.md), [**gfs\_pio\_set\_local**(3)](/gfs_pio_set_local/3.md), [**gfs\_pio\_set\_view\_index**(3)](/gfs_pio_set_view_index/3.md)
