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

Chapter 5 Manager Overview

because the physical implementation of the file system is hidden from the user.

How you identify a target depends upon whether the target is an open or closed file. If a target is a closed file or a directory, you specify the target using the target's path. The path describes the volume containing the target, the directories between the top level and the target, and the target's name. If the target is an open file, you use a file descriptor to specify that LabVIEW should perform an operation on the open file.

The file descriptor is an identifier that the file manager associates with the file when you open it. When you close the file, the file manager dissociates the file descriptor from the file.

Path Specifications

Conventional Path Specifications

All platforms have a method for describing the paths for files and directories. These path specifications are similar, but they are usually incompatible from one platform to another. You usually specify a path as a series of names separated by separator characters. Typically, the first name is the top level of the hierarchical specification of the path, and the last name is the file or directory that the path identifies.

There are two types of paths—relative paths and absolute paths. A relative path describes the location of a file or directory relative to an arbitrary location in the file system. An absolute path describes the location of a file or directory starting from the top level of the file system.

A path does not necessarily go from the top of the hierarchy down to the target. You can often use a platform-specific tag in place of a name that indicates that the path should go up a level from the current location.

For instance, on a UNIX system, you specify the path of a file or directory as a series of names separated by the slash ( / ) character. If the path is an absolute path, you begin the specification with a slash. You can indicate that the path should move up a level using two periods in a row ( .. ). Thus, the following path specifies a file README relative to the top level of the file system.

/usr/home/gregg/myapps/README

Two relative paths to the same file are as follows.

LabVIEW Code Interface Reference Manual

5-14

© National Instruments Corporation

 

Chapter 5 Manager Overview

gregg/myapps/README

relative to /usr/home

../myapps/README

relative to a directory

 

inside of the gregg directory

On the PC, you separate names in a path with a backslash ( \ ) character. If the path is an absolute path, you begin the specification with a drive designation, followed by a colon ( : ), followed by the backslash. You can indicate that the path should move up a level using two periods in a row ( .. ). Thus, the following path specifies a file README relative to the top level of the file system, on a drive named C.

C:\HOME\GREGG\MYAPPS\README

Two relative paths to the same file are as follows.

GREGG\MYAPPS\README

relative to the HOME directory

..\MYAPPS\README

relative to a directory inside of

 

the GREGG directory

On the Macintosh, you separate names in a path with the colon ( : ) character. If the path is an absolute path, you begin the specification with the name of the volume containing the file. If an absolute path consists of only one name (it specifies a volume), it must end with a colon. If the path is a relative path, it begins with a colon. This colon is optional for a relative path consisting of only one name. You can indicate that the path should move up a level using two colons in a row ( :: ). Thus, the following path specifies a file README relative to the top level of the file system, on a drive named Hard Drive.

Hard Drive:Home:Gregg:MyApps:README

Two relative paths to the same file are as follows.

:Gregg:MyApps:README

relative to the Home directory

::MyApps:README

relative to a directory inside of

 

the Gregg directory

Empty Path Specifications

In LabVIEW you can define a path with no names, called an empty path. An empty path is either absolute or relative. The empty absolute path is the highest point you can specify in the file hierarchy. The empty relative path is a path relative to an arbitrary location in the file system to itself.

© National Instruments Corporation

5-15

LabVIEW Code Interface Reference Manual

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