Table of Contents

NAME

gfs_create_file - create a file

SYNOPSIS

#include <gfs.h>

int gfs_create_file(char *filename, int *ioplist, int num_iops);

DESCRIPTION

gfs_create_file attempts to create a file which spans num_iops disks. The application can even provide Galley with the actual list of IOPs on which it wishes to create the file. If num_iops is set to 0, the file will span all the disks in the system. If ioplist is NULL, the file system will decide which disks the file will be created on.

This function will most commonly be called like this:

err = gfs_create_file("myfile", NULL, 0);

This will create a file called "myfile" with one subfile on each IOP.

RETURN VALUE

gfs_create_file returns 0 if the file was successfully created, or -1 if an error occurred (in which case, gfs_errno is set appropriately).

Unlike the Unix interface, gfs_create_file does not open the file, or return a file descriptor. Files must be explicitly opened.

ERRORS

GFS_EEXIST
filename already exists.

GFS_ENAMETOOLONG
filename was too long.

GFS_ENOSPC
filename was to be created, but one or more disks had no room for the new file.


Table of Contents