main logo
Subject: Re: [C++] Support of all: char* path, POSIX path, FSRef, FSSpec
Author: Ruslan Zasukhin
Posted: 2002/11/27 16:40:47
 
View Entire Thread
New Search


> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--B_3121285247_4155396
Content-type: text/plain; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

on 11/27/02 11:03 PM, Totte Alm at totte (AT) code66 .D.OT se wrote:

=20
> CFString has tons of great functionality, its a little hard to
> understand as it comes from the CocoaWorld, but ReferenceCounting is
> good when you learn how to use it.
>=20
> If you have something, please send me and I can look at it.

Totte,

I have the next function (from MoreFiles X in fact)



#ifdef __MACH__
//
// NOTE: fullPath to item that EXISTS on disk. Otherwise file not found
error.
//
OSErr FBL_Path2Spec( const char *fullPath, FSSpec *spec)
{
FSRef ref;

/* convert the POSIX path to an FSRef */
OSStatus result =3D FSPathMakeRef( (uchar*)fullPath, &ref, NULL);

/* and then convert the FSRef to an FSSpec */
if( result =3D=3D 0 )
result =3D FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL, spec,
NULL);
=20
return (OSErr) result;
}



Again, I can parse fullPath to extract path to parent folder only.
I can make FSRef for folder.
I can convert it to FSSpec as shown above.

But not question is how to get FSSpec of NOT EXISTED target file.

parentFSSpec + =B3name=B2 =3D fileFSSpec

??????????????????????????????????


Having this I could simply not change kernel inside, just convert unix path
to FSSpec.
Or FSRef + name into FSSpec
=20

--=20
Best regards,
Ruslan Zasukhin [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan@paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list
send a letter to valentina-on (AT) lists .D.OT macserve.net
-------------------------------------------------------------


--B_3121285247_4155396
Content-type: text/html; charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable

<HTML>
<HEAD>
<TITLE>Re: [C++] Support of all: char* path, POSIX path, FSRef, FSSpec</TIT=
LE>
</HEAD>
<BODY>
<FONT FACE=3D"Monaco"><TT>on 11/27/02 11:03 PM, Totte Alm at totte@code66.se =
wrote:<BR>
<BR>
 <BR>
<FONT COLOR=3D"#000098">> CFString has tons of great functionality, its a =
little hard to  <BR>
> understand as it comes from the CocoaWorld, but ReferenceCounting is &=
nbsp;<BR>
> good when you learn how to use it.<BR>
> <BR>
> If you have something, please send me and I can look at it.<BR>
</FONT><BR>
Totte,<BR>
<BR>
I have the next function (from MoreFiles X in fact)<BR>
<BR>
<HR ALIGN=3DCENTER SIZE=3D"3" WIDTH=3D"95%"><BR>
#ifdef __MACH__<BR>
//<BR>
// NOTE:  fullPath to item that EXISTS on disk. Otherwise file not fou=
nd error.<BR>
//<BR>
OSErr FBL_Path2Spec( const char *fullPath, FSSpec *spec)<BR>
{<BR>
    FSRef ref;<BR>
<BR>
    /* convert the POSIX path to an FSRef */<BR>
    OSStatus result =3D FSPathMakeRef( (uchar*)fullPath, =
&ref, NULL);<BR>
<BR>
    /* and then convert the FSRef to an FSSpec */<BR>
    if( result =3D=3D 0 )<BR>
        result =3D FSGetCatalogInfo(&=
amp;ref, kFSCatInfoNone, NULL, NULL, spec, NULL);<BR>
    <BR>
    return (OSErr) result;<BR>
}<BR>
<BR>
<HR ALIGN=3DCENTER SIZE=3D"3" WIDTH=3D"95%"><BR>
Again, I can parse fullPath to extract path to parent folder only.<BR>
I can make FSRef for folder.<BR>
I can convert it to FSSpec as shown above.<BR>
<BR>
But not question is how to get FSSpec of NOT EXISTED target file. <BR>
<BR>
    parentFSSpec + “name” =3D fileFSSpec<BR>
<BR>
    ??????????????????????????????????<BR>
<BR>
<BR>
Having this I could simply not change kernel inside, just convert unix path=
to FSSpec.<BR>
Or FSRef + name into FSSpec<BR>
    <BR>
<BR>
-- <BR>
Best regards,<BR>
Ruslan Zasukhin      [ I feel the need...the need =
for speed ]<BR>
-------------------------------------------------------------<BR>
e-mail: ruslan (AT) paradigmasoft .D.OT com<BR>
web: http://www.paradigmasoft.com<BR>
<BR>
To subscribe to the Valentina mail list<BR>
send a letter to valentina-on@lists.macserve.net<BR>
-------------------------------------------------------------<BR>
</TT></FONT>
</BODY>
</HTML>


--B_3121285247_4155396--


--B_3121285247_4155396
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
 
©2002 Ruslan Zasukhin
<-- Prior Message New Search Next Message -->