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

Chapter 6 Function Descriptions

FGetPathType

MgErr FGetPathType(path, typePtr)

Purpose

Returns the type (relative, absolute, or not a path) of a path.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path whose type you want to determine.

 

 

 

typePtr

int32 *

Address at which FGetPathType stores

 

 

the type. *typePtr can have the following

 

 

values:

 

 

fAbsPath—The path is absolute.

 

 

fRelPath—The path is relative.

 

 

fNotAPath—The path is the

 

 

canonical invalid path or an error

 

 

occurred.

 

 

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.

Using External Code in LabVIEW

6-72

www.ni.com

Chapter 6 Function Descriptions

FGetVolInfo

MgErr FGetVolInfo(path, vinfo);

Purpose

Gets a path specification and information for the volume containing the specified file or directory.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path of a file or directory contained on the

 

 

volume from which you want to get

 

 

information. This path is overwritten with a

 

 

path specifying the volume containing the

 

 

specified file or directory. If an error occurs,

 

 

path is undefined.

 

 

 

vinfo

VInfoRec *

Address at which FgetVolInfo stores the

 

 

information about the volume. If an error

 

 

occurs, vinfo is undefined. Refer to the

 

 

Pointers as Parameters section in Chapter 3,

 

 

CINs, for more information about using this

 

 

parameter.

 

 

 

The following code describes the volume information record, VInfoRec:

typedef struct {

uint32

size;

/* size in bytes of a

 

 

volume */

uint32

used;

/* number of bytes used on

 

 

volume */

uint32

free;

/* number of bytes available

 

 

for use on volume */

}VInfoRec;

Return Value

mgErr, which can contain the following errors:

mgArgErr

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

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-73

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FileNameCmp

Macro

int32 FileNameCmp(s1, s2);

Purpose

Lexically compares two file names, to determine whether one is less than, equal to, or greater than the other. This comparison uses the same case sensitivity as the file system, that is, case-insensitive for Macintosh and Windows, case-sensitive for SPARCstation.

Parameters

Name

Type

Description

 

 

 

 

 

 

s1

PStr

Pointer to a Pascal string.

 

 

 

s2

PStr

Pointer to a Pascal string.

 

 

 

Return Value

<0, 0, or >0 if s1 is less than, equal to, or greater than s2, respectively. Returns <0 if s1 is an initial substring of s2.

Using External Code in LabVIEW

6-74

www.ni.com

Chapter 6 Function Descriptions

FileNameIndCmp

Macro

int32 FileNameIndCmp(s1p, s2p);

Purpose

This function is similar to FileNameCmp, except you pass the function handles to the string data instead of pointers. Use this function to compare two file names lexically and determine whether one is less than, equal to, or greater than the other. This comparison uses the same case sensitivity as the file system, that is, case-insensitive for Macintosh and Windows, case-sensitive for SPARCstation.

Parameters

Name

Type

Description

 

 

 

 

 

 

s1p

PStr *

Pointer to a Pascal string.

 

 

 

s2p

PStr *

Pointer to a Pascal string.

 

 

 

Return Value

<0, 0, or >0 if s1p is less than, equal to, or greater than s2p, respectively. Returns <0 if s1p is an initial substring of s2p.

© National Instruments Corporation

6-75

Using External Code in LabVIEW

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