delorie.com/djgpp/doc/libc/libc_380.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

_get_volume_info

Syntax

 
#include <fcntl.h>
 
unsigned _get_volume_info (const char *path, 
                           int *max_file_len, int *max_path_len, 
                           char *fsystype);

Description

This function returns filesystem information about the volume where path resides. Only the root directory name part is actually used; if path does not specify the drive explicitly, or is a NULL pointer, the current drive is used. Upon return, the variable pointed to by max_file_len contains the maximum length of a filename (including the terminating zero), the variable pointed to by max_path_len contains the maximum length of a pathname (including the terminating zero), and a string that identifies the filesystem type (e.g., "FAT", "NTFS" etc.) is placed into the buffer pointed to by fsystype, which should be long enough (32 bytes are usually enough). If any of these pointers is a NULL pointer, it will be ignored. The function returns various flags that describe features supported by the given filesystem as a bit-mapped number. The following bits are currently defined:

_FILESYS_CASE_SENSITIVE
Specifies that file searches are case-sensitive.

_FILESYS_CASE_PRESERVED
Filename letter-case is preserved in directory entries.

_FILESYS_UNICODE
Filesystem uses Unicode characters in file and directory names.

_FILESYS_LFN_SUPPORTED
Filesystem supports the Long File Name (LFN) API.

_FILESYS_VOL_COMPRESSED
This volume is compressed.

_FILESYS_UNKNOWN
The underlying system call failed. This usually means that the drive letter is invalid, like when a floppy drive is empty or a drive with that letter doesn't exist.

Return value

A combination of the above bits if the LFN API is supported, or 0 (and errno set to ENOSYS) if the LFN API is not supported by the OS. If the LFN API is supported, but the drive letter is invalid, the function returns _FILESYS_UNKNOWN and sets errno to either ENODEV or ENXIO.

Portability

ANSI/ISO C No
POSIX No


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright © 2004     Updated Apr 2004