Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Using External Code in LabVIEW.pdf
Скачиваний:
49
Добавлен:
29.05.2015
Размер:
1.85 Mб
Скачать

Chapter 6 Function Descriptions

FLockOrUnlockRange

MgErr FLockOrUnlockRange(fd, mode, offset, count, lock);

Purpose

Locks or unlocks a section of a file.

Parameters

Name

Type

Description

 

 

 

 

 

 

fd

File

File descriptor associated with the file.

 

 

 

mode

int32

Position in the file relative to which

 

 

FLockOrUnlockRange determines the first

 

 

byte to lock or unlock, using the following

 

 

values:

 

 

fStart—The first byte to lock or

 

 

unlock is located offset bytes from

 

 

the start of the file (offset must be

 

 

greater than or equal to 0).

 

 

fCurrent—The first byte to lock

 

 

or unlock is located offset bytes

 

 

from the current position mark

 

 

(offset can be positive, 0, or

 

 

negative).

 

 

fEnd—The first byte to lock or

 

 

unlock is located offset bytes from

 

 

the end of the file (offset must be

 

 

less that or equal to 0).

 

 

 

offset

int32

The position of the first byte to lock or

 

 

unlock. The position is the number of bytes

 

 

from the beginning of the file, the current

 

 

position mark, or the end of the file, as

 

 

determined by mode.

 

 

 

count

int32

Number of bytes to lock or unlock starting at

 

 

the location specified by mode and offset.

 

 

 

lock

Bool32

Indicates whether FLockOrUnlockRange

 

 

locks or unlocks a range of bytes. If TRUE the

 

 

function locks a range; if FALSE the function

 

 

unlocks a range.

 

 

 

Using External Code in LabVIEW

6-84

www.ni.com

Chapter 6 Function Descriptions

Return Value

mgErr, which can contain the following errors:

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-85

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FMakePath

Path FMakePath(path, type, [volume, directory, directory, ..., name,] NULL);

The brackets indicate that the volume, directory, and name parameters are optional.

Purpose

Creates a new path. If path is NULL, this function allocates and returns a new path. Otherwise, path is set to the new path and this function returns path. If an error occurs, or path is not specified correctly, the function returns NULL.

When you finish using a path, dispose of it using FDisposePath.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Parameter in which FMakePath returns the

 

 

new path if path is not NULL.

 

 

 

type

int32

Type of path you want to create. If

 

 

fAbsPath, the new path is absolute. If

 

 

fRelPath, the new path is relative.

 

 

 

volume

PStr

(Optional) Pascal string containing a legal

 

 

volume name. An empty string indicates to

 

 

go up a level in the path hierarchy. This

 

 

parameter is used only for absolute paths in

 

 

Macintosh or Windows.

 

 

 

directory

PStr

(Optional) Pascal string containing a legal

 

 

directory name. An empty string indicates to

 

 

go up a level in the path hierarchy.

 

 

 

name

PStr

(Optional) File or directory name. An empty

 

 

string indicates to go up a level in the path

 

 

hierarchy.

 

 

 

NULL

PStr

Marker indicating the end of the path.

 

 

 

Return Value

The resulting path; if you specified path, the return value is the same as path. If an error occurs, this function returns NULL.

Using External Code in LabVIEW

6-86

www.ni.com

Chapter 6 Function Descriptions

FMClose

MgErr FMClose(fd);

Purpose

Closes the file associated with the file descriptor fd.

Parameters

Name

Type

Description

 

 

 

 

 

 

fd

File

File descriptor associated with the file you

 

 

want to close.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

Not a valid file descriptor.

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-87

Using External Code in LabVIEW

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]