Is there a way to get the case sensitivity setting (true or false) of a mounted share? Ideally it could be of any type - AFP, SMB, WebDAV, etc.
I was hoping it would just be in “properties” of the alias of the drive in Applescript, but it’s not.
Googling this, I found the shell command “getattrlist” which looks promising - it has the property “VOL_CAP_FMT_CASE_SENSITIVE.” When I found that, I thought I was done. But I just bumble my way through the shell, and the usage examples included in the man page are alien to me… I’m used to shell commands that are one line with a couple arguments and a few flags… this looks like an Objective C program? Any help from the ASObjC people, or any other way to find this info?
EXAMPLES
The following code prints the file type and creator of a file, assuming that the volume
supports the required attributes.
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <sys/attr.h>
#include <sys/errno.h>
#include <unistd.h>
#include <sys/vnode.h>
typedef struct attrlist attrlist_t;
struct FInfoAttrBuf {
u_int32_t length;
fsobj_type_t objType;
char finderInfo[32];
} __attribute__((aligned(4), packed));
typedef struct FInfoAttrBuf FInfoAttrBuf;
static int FInfoDemo(const char *path)
{
int err;
attrlist_t attrList;
FInfoAttrBuf attrBuf;
memset(&attrList, 0, sizeof(attrList));
attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
attrList.commonattr = ATTR_CMN_OBJTYPE | ATTR_CMN_FNDRINFO;
err = getattrlist(path, &attrList, &attrBuf, sizeof(attrBuf), 0);
if (err != 0) {
err = errno;
}
if (err == 0) {
assert(attrBuf.length == sizeof(attrBuf));
printf("Finder information for %s:\n", path);
switch (attrBuf.objType) {
case VREG:
printf("file type = '%.4s'\n", &attrBuf.finderInfo[0]);
printf("file creator = '%.4s'\n", &attrBuf.finderInfo[4]);
break;
case VDIR:
printf("directory\n");
break;
default:
printf("other object type, %d\n", attrBuf.objType);
break;
}
}
return err;
}