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

Chapter 6 Function Descriptions

FGetAccessRights

MgErr FGetAccessRights(path, owner, group, permPtr);

Purpose

Returns access rights information about the specified file or directory.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path of the file or directory about which you

 

 

want access rights information.

 

 

 

owner

PStr

Address at which FGetAccessRights

 

 

stores the owner of the file or directory.

 

 

 

group

PStr

Address at which FGetAccessRights

 

 

stores the group of the file or directory.

 

 

 

permPtr

int32 *

Address at which FGetAccessRights

 

 

stores the permissions of the file or directory.

 

 

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.

FNotFound

File not found.

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-67

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FGetDefGroup

LStrHandle FGetDefGroup(groupHandle);

Purpose

Gets the LabVIEW default group for a file or directory.

Parameters

Name

Type

Description

 

 

 

 

 

 

groupHandle

LStrHandle

Handle that represents the LabVIEW default

 

 

group for a file or directory. If groupHandle

 

 

is NULL, FGetDefGroup allocates a new

 

 

handle and returns the default group in it. If

 

 

groupHandle is a handle, FGetDefGroup

 

 

returns it, and groupHandle resizes to hold

 

 

the default group.

 

 

 

Return Value

The resulting LStrHandle. If groupHandle was not NULL, the return value is the same LStrHandle as groupHandle. If an error occurs, this function returns NULL.

Using External Code in LabVIEW

6-68

www.ni.com

Chapter 6 Function Descriptions

FGetEOF

MgErr FGetEOF(fd, sizep);

Purpose

Returns the size of the specified file.

Parameters

Name

Type

Description

 

 

 

 

 

 

fd

File

File descriptor associated with the file.

 

 

 

sizep

int32 *

Address at which FGetEOF stores the size of

 

 

the file in bytes. If an error occurs, *sizep is

 

 

undefined. 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

Not a valid file descriptor.

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-69

Using External Code in LabVIEW

Chapter 6 Function Descriptions

FGetInfo

MgErr FGetInfo(path, infop);

Purpose

Returns information about the specified file or directory.

Parameters

Name

Type

Description

 

 

 

 

 

 

path

Path

Path of the file or directory about which you

 

 

want information.

 

 

 

infop

FInfoPtr

Address where FGetInfo stores

 

 

information about the file or directory. If an

 

 

error occurs, infop is undefined. Refer to the

 

 

Pointers as Parameters section in Chapter 3,

 

 

CINs, for more information about using this

 

 

parameter.

 

 

 

FInfoPtr is a data structure that defines the attributes of a file or directory. The following code lists the file/directory information record, FInfoPtr.

typedef struct {

int32

type;

* system specific file type--

 

 

0 for directories */

int32

creator;

* system specific file

 

 

creator-- 0 for folders (on

 

 

Mac only)*/

int32

permissions;

* system specific file access

 

 

rights */

int32

size;

/* file size in bytes (data

 

 

fork on Mac) or entries in

 

 

directory*/

int32

rfSize;

/* resource fork size (on Mac

 

 

only) */

uint32

cdate;

/* creation date: seconds

 

 

since system reference time

 

 

*/

uint32

mdate;

/* last modification date:

 

 

seconds since system ref time

 

 

*/

Using External Code in LabVIEW

6-70

www.ni.com

 

 

Chapter 6 Function Descriptions

Bool32

folder;

/* indicates whether path

 

 

refers to a folder */

Bool32

isInvisible;

/* indicates whether file is

 

 

visible in File Dialog (on

 

 

Mac only)*/

Point

location;

/* system specific desktop

 

 

geographical location (on Mac

 

 

only)*/

Str255

owner;

/* owner (in pascal string

 

 

form) of file or folder */

Str255

group;

/* group (in pascal string

 

 

form) of file or folder */

}

FInfoRec, *FInfoPtr;

Return Value

mgErr, which can contain the following errors:

mgArgErr

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

FNotFound

File not found.

fIOErr

Unspecified I/O error.

© National Instruments Corporation

6-71

Using External Code in LabVIEW

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