Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Labview Code Interface Reference Manual.pdf
Скачиваний:
33
Добавлен:
29.05.2015
Размер:
1.13 Mб
Скачать

File Manager Functions

Chapter

 

7

File Manager Data Structures

 

File/Directory Information Record

Several routines in the file manager work with a data structure that defines the attributes of a file or directory. The following list gives the file/directory information record.

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

 

 

*/

Bool32

folder;

/* indicates whether path

 

 

refers to a folder */

Bool32

isInvisible;

/* indicates whether file is

 

 

visible in File Dialog (on

 

 

Mac only)*/

National Instruments Corporation

7-1

LabVIEW Code Interface Reference Manual

Chapter 7 File Manager Functions

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;

File Type Record

The file type record is:

typedef struct {

int32 flags;

int32 type;

}FileType;

Only the least significant four bits of flags contain useful information. The remaining bits are reserved for use by LabVIEW. You can test these four bits using the following four masks:

#define kIsFile 0x01

#define kRecognizedType 0x02

#define kIsLink 0x04

#define kFIsInvisible 0x08

The kIsFile bit is set if the item described by the file type record is a file; otherwise it is clear. The kRecognizedType bit is set if the item described is a file for which you can determine a 4-character file type; otherwise it is clear. The kIsLink bit is set if the item described is a UNIX link or Macintosh alias; otherwise it is clear. The kFIsInvisible bit is set if the item described will not appear in a file dialog; otherwise it is clear.

The value of type is defined only if the kRecognizedType bit is set in flags. In this case, type is the 4-character file type of the file described by the file type record. This 4-character file type is provided by the file system on the Macintosh and is computed by examining the file name extension on other systems.

LabVIEW Code Interface Reference Manual

7-2

National Instruments Corporation

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