A file system driver that uses a block device driver for I/O operations to a local or remote (virtual disk) device is called a local file system. A file system driver that accesses a remote system without a block device driver is called a remote file system.
An application, typically a network application, can call DosFSAttach to:
DosFSAttach establishes or breaks the connection between a drive or device and a file system. If an attachment is successful, all requests to that drive or name are routed to the specified file system. If a detachment is successful, the operating system will no longer recognize the drive or name in a file system call.
DosFSAttach does not support:
A name space is a set of names that are known to the file system. For example, CON (console) and PRN (printer) are always in the OS/2 file system's name space.
The following code fragment attaches a drive to a remote file system driver (FSD). Assume that the FSD does not require any user-supplied data arguments.
#define INCL_DOSFILEMGR /* File System values */ #include <os2.h> #include <stdio.h> #include <string.h> UCHAR ucDeviceName[8]; /* Device name or drive letter string */ UCHAR ucFSDName[40]; /* FSD name */ PVOID pDataBuffer; /* Attach argument data */ ULONG ulDataBufferLen; /* Buffer length */ ULONG ulOpFlag; /* Attach or detach */ APIRET ulrc; /* Return code */ strcpy(ucDeviceName,"Y:"); /* Drive letter with which to attach the */ /* file system driver */ strcpy(ucFSDName,"\\lan03\\src"); pDataBuffer = 0; /* Assume that no user-supplied data */ /* arguments are required */ ulDataBufferLen = 0; /* No data buffer supplied */ ulOpFlag = 0; /* Indicate Attach request */ ulrc = DosFSAttach(ucDeviceName, ucFSDName, pDataBuffer, ulDataBufferLen, ulOpFlag); if (ulrc != 0) { printf("DosFSAttach error: return code = %ld", ulrc); return; }