lockSeg()  mkTmp()

Chapter 5: General Objects and Methods

mkNewFile()

Description

Creates a file at the specified location, writes the contents of the data parameter to it, and associates the I/O file object to the new file.

Syntax

mkNewFile(string *location, blob *data);

Parameter

Description

location

Pointer to the string object that identifies where to create the file.

data

Pointer to the blob from which to retrieve the data to write to a file.

Return value

Integer. Returns 1 for success, and 0 for failure.

Usage

The location parameter can be an absolute or relative path. When location contains at least one forward slash (/), the software interprets it as an actual path. Use a forward slash (/) in the path for both Windows and UNIX paths. Use “./” to specify the current directory.

Pointer to object

Object

string loc;blob data;loc = “/usr/tmp”;data = “a bunch of data...”piof->mkNewFile(&loc, &data);

string loc;blob data;loc = “/usr/tmp”;data = “a bunch of data...”my)_iofobj.mkNewFile(&loc, &data);





Copyright © 2005. Sybase Inc. All rights reserved. mkTmp()

View this book as PDF