|
From: <lab...@us...> - 2015-04-14 21:38:08
|
Revision: 1509
http://sourceforge.net/p/opengtoolkit/svn/1509
Author: labviewer
Date: 2015-04-14 21:38:01 +0000 (Tue, 14 Apr 2015)
Log Message:
-----------
More MacOS X changes
Modified Paths:
--------------
trunk/lvzip/c_source/lvutil.c
trunk/lvzip/c_source/lvutil.h
Modified: trunk/lvzip/c_source/lvutil.c
===================================================================
--- trunk/lvzip/c_source/lvutil.c 2015-04-14 20:44:01 UTC (rev 1508)
+++ trunk/lvzip/c_source/lvutil.c 2015-04-14 21:38:01 UTC (rev 1509)
@@ -382,10 +382,10 @@
LStrHandle comment)
{
MgErr err = mgNoErr;
-#if MacOS
-#if !MacOSX
+#if MacOSX
+ FInfoRec64 infoRec;
+#elif MacOS
FSRef ref;
-#endif
#elif Win32
LStrPtr lstr;
HANDLE handle = NULL;
@@ -404,11 +404,37 @@
#if MacOSX
if (write)
{
- err = FSetInfo(path, fileInfo);
+ infoRec.creator = fileInfo->creator;
+ infoRec.type = fileInfo->type;
+ infoRec.permissions = 0;
+ infoRec.size = fileInfo->size;
+ infoRec.rfSize = fileInfo->rfSize;
+ infoRec.cdate = fileInfo->cDate;
+ infoRec.mdate = fileInfo->mDate;
+ infoRec.folder = *isDirectory;
+ infoRec.isInvisible = fileInfo->flags & kFIsInvisible;
+ infoRec.location.v = fileInfo->location.v;
+ infoRec.location.h = fileInfo->location.h;
+ infoRec.owner[0] = 0;
+ infoRec.group[0] = 0;
+ err = FSetInfo64(path, &infoRec);
}
else
{
- err = FGetInfo(path, fileInfo);
+ err = FGetInfo64(path, &infoRec, kFGetInfoAll);
+ if (!err)
+ {
+ fileInfo->creator = infoRec.creator;
+ fileInfo->type = infoRec.type;
+ fileInfo->size = infoRec.size;
+ fileInfo->rfSize = infoRec.rfSize;
+ fileInfo->cDate = infoRec.cdate;
+ fileInfo->mDate = infoRec.mdate;
+ *isDirectory = infoRec.folder;
+ fileInfo->flags = infoRec.isInvisible ? kFIsInvisible : 0;
+ fileInfo->location.v = infoRec.location.v;
+ fileInfo->location.h = infoRec.location.h;
+ }
}
#elif MacOS
err = FSMakePathRef(path, &ref);
@@ -1021,7 +1047,7 @@
if (0 == ioRefNum)
return mgArgErr;
#if MacOSX
- return OSErrToLVErr(FSGetForkPosition(ioRefNum, tell));
+ return OSErrToLVErr(FSGetForkPosition(ioRefNum, &tell->q));
#elif Unix
errno = 0;
tell->q = ftello64(ioRefNum);
@@ -1584,7 +1610,7 @@
}
/* Converts a Unix style path to a LabVIEW platform path */
-LibAPI(MgErr) ConvertCPath(ConstCStr src, int32 srclen, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed)
+LibAPI(MgErr) ConvertCPath(ConstCStr src, int32 srclen, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed, LVBoolean isDir)
{
MgErr err = mgNotSupported;
#if Win32
@@ -1707,7 +1733,7 @@
#endif
/* Converts a LabVIEW platform path to Unix style path */
-LibAPI(MgErr) ConvertLPath(const LStrHandle src, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed)
+LibAPI(MgErr) ConvertLPath(const LStrHandle src, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed, LVBoolean isDir)
{
MgErr err = mgNotSupported;
#if Win32
Modified: trunk/lvzip/c_source/lvutil.h
===================================================================
--- trunk/lvzip/c_source/lvutil.h 2015-04-14 20:44:01 UTC (rev 1508)
+++ trunk/lvzip/c_source/lvutil.h 2015-04-14 21:38:01 UTC (rev 1509)
@@ -441,7 +441,9 @@
enum { fAbsPath, fRelPath, fNotAPath, fUNCPath, nPathTypes}; /* path type codes */
Private(File);
-PrivateH(Path);
+typedef struct PATHREF PathRef;
+typedef PathRef* Path;
+typedef const PathRef* ConstPath;
typedef MagicCookie LVRefNum;
#define kNotARefNum ((LVRefNum)0L) /* canonical invalid magic cookie */
@@ -459,7 +461,7 @@
MgErr FDisposeRefNum(LVRefNum);
MgErr FRefNumToFD(LVRefNum, File*);
MgErr FGetInfo(ConstPath path, FInfoPtr infop);
-MgErr FGetInfo64(ConstPath path, FInfo64Ptr infop, FGetInfoWhich which));
+MgErr FGetInfo64(ConstPath path, FInfo64Ptr infop, FGetInfoWhich which);
MgErr FSetInfo(ConstPath path, FInfoPtr infop);
MgErr FSetInfo64(ConstPath path, FInfo64Ptr infop);
@@ -546,9 +548,9 @@
LibAPI(MgErr) WideStringToMultiByte(const UStrHandle src, LStrHandle *dest, uInt32 codePage, char defaultChar, LVBoolean *defaultCharWasUsed);
LibAPI(MgErr) ConvertCString(ConstCStr src, int32 srclen, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed);
-LibAPI(MgErr) ConvertCPath(ConstCStr src, int32 srclen, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed);
+LibAPI(MgErr) ConvertCPath(ConstCStr src, int32 srclen, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed, LVBoolean isDir);
LibAPI(MgErr) ConvertLString(const LStrHandle src, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed);
-LibAPI(MgErr) ConvertLPath(const LStrHandle src, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed);
+LibAPI(MgErr) ConvertLPath(const LStrHandle src, uInt32 srccp, LStrHandle *dest, uInt32 destcp, char defaultChar, LVBoolean *defUsed, LVBoolean isDir);
#ifdef __cplusplus
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|