SYNOPSIS
#include <unistd.h>
int mount(int char *spec, const char *dir, int mflag...);
DESCRIPTION
After a successful call to
The low-order bit of mflag controls write permission on the mounted file system: if it is 1, writing is forbidden; otherwise, writing is permitted according to the individual file accessibility.
The
PARAMETERS
- spec
-
identifies the file system to be mounted at the mount point.
- dir
-
identifies the directory to be used as the mount point for the mounted file system.
- mflag
-
is a set of flags that describes which optional arguments are present.
RETURN VALUES
If successful,
- EFAULT
-
spec or dir is an invalid pointer.
- EINVAL
-
spec or dir contains an invalid character.
- ENAMETOOLONG
-
The length of the spec or dir parameter exceeds PATH_MAX or a path name component is longer than NAME_MAX.
- ENOTDIR
-
spec or dir contains an invalid character.
CONFORMANCE
UNIX 98, with exceptions.
PORTING ISSUES
The value passed in mflag is ignored — read-only mounts
are not supported.
The
There are 3 different ways in which the NuTCRACKER Platform
-
The
mount() function can be used to mount a network share point and associate it with an unused drive letter. For this type of mount, the spec argument must be the name of the network share point (for example, //hostname/sharepoint, or hostname:/sharepoint). The mount point must be an unused drive letter (for example, t:/). Usingmount() to mount a network share is supported for all systems that the NuTCRACKER Platform supports.The
mount() function can be used to do substitution style mounts. In this instance, the spec argument must indicate an existing directory, and the dir argument must point to an unused drive letter. Usingmount() to perform substitution style mounts is only supported on 10/2016/2019/11/2022/2025.The
mount() function requests that a Windows Volume (a bit like a UNIX block special device in this context), directory, or network share identified by spec be mounted on the directory or drive letter identified by dir. spec and dir are pointers to path names. -
The
mount() function can be used to mount a volume onto a directory or unused drive letter. If passed an existing drive letter and there is a volume mounted on that drive letter, that volume is then mounted onto the new mount point.For example, if //?/Volume{2a537b5c-924e-11d7-a242-806e6f6e6963}/ is mounted on r:/ and q:/ is an unused drive letter:
mount("//?/Volume{2a537b5c-924e-11d7-a242-806e6f6e6963}/", "q:/", 0);
or
mount("r:/", "q:/", 0);
mounts the same volume on q:/ as is on r:/.
The mount point can be any NTFS directory as well as a drive letter:
mount("//?/Volume{2a537b5c-924e-11d7-a242-806e6f6e6963}/", "c:/mnt/cdrom", 0);
In which case, the specified volume mounted on c:/mnt/cdrom, just like a block special device (for example, like /dev/hda3 on Linux) would be mounted on a directory on UNIX systems. Using
mount() to perform this style of mount is only supported on 2016/2019/2022/2025 on local NTFS5 file systems.
SEE ALSO
- Functions:
umount()
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.5 Documentation Build 40.