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

Chapter 6 Function Descriptions

FName

MgErr FName(path, name);

Purpose

Copies the last component name of a specified path into a string handle and resizes the handle as necessary.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path whose last component name you want

 

 

to determine.

 

 

 

name

StringHandle

Handle in which FName returns the last

 

 

component name as a Pascal string.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

Badly formed path or path is root directory.

mFullErr

Insufficient memory.

Using External Code in LabVIEW

6-96

www.ni.com

Chapter 6 Function Descriptions

FNamePtr

MgErr FNamePtr(path, name);

Purpose

Copies the last component name of a path to the address specified by name. This routine does not allocate space for the returned data, so name must specify allocated memory of sufficient size to hold the component name.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path whose last component name you want

 

 

to determine.

 

 

 

name

PStr

Address at which FNamePtr stores the last

 

 

component name as a Pascal string. This

 

 

address must specify allocated memory of

 

 

sufficient size to hold the name. Refer to the

 

 

Pointers as Parameters section in Chapter 3,

 

 

CINs, for more information about using this

 

 

parameter.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

Badly formed path or path is root directory.

mFullErr

Insufficient memory.

© National Instruments Corporation

6-97

Using External Code in LabVIEW

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FNewDir

MgErr FNewDir(path, permissions);

Purpose

Creates a new directory with the specified permissions. If an error occurs, the function does not create the directory.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path of the directory you want to create.

 

 

 

permissions

int32

Permissions for the new directory.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

fNoPerm

Access was denied; the file, directory, or disk is locked or

 

protected.

fDupPath

Directory already exists.

fIOErr

Unspecified I/O error.

6-98

www.ni.com

Chapter 6 Function Descriptions

FNewRefNum

MgErr FNewRefNum(path, fd, refNumPtr);

Purpose

Creates a new file refnum for an open file with the name and location specified by path and the file descriptor fd.

If the file refnum is created, the resulting file refnum is stored in the address referred to by refNumPtr. If an error occurs, NULL is stored in the address referred to by refNumPtr and the error is returned.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path of the open file for which you want to

 

 

create a file refnum.

 

 

 

fd

File

File descriptor of the open file for which you

 

 

want to create a file refnum.

 

 

 

refNumPtr

LVRefNum *

Address at which FNewRefNum stores the

 

 

new file refnum. Refer to the Pointers as

 

 

Parameters section in Chapter 3, CINs, for

 

 

more information about using this parameter.

 

 

 

Return Value

mgErr, which can contain the following errors:

mgArgErr

A bad argument was passed to the function. Verify the path.

mFullErr

Insufficient memory.

© National Instruments Corporation

6-99

Using External Code in LabVIEW

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