realbasic-nug
[Top] [All Lists]

Re: Encodings, Trademarks, Files, and POSIX

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Encodings, Trademarks, Files, and POSIX
From: "Rubber Chicken Software Co." <support@chickensys.com>
Date: Thu, 30 Apr 2009 17:00:07 -0500
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com; domainkeys=neutral header.From=support@chickensys.com
Delivered-to: listarchive@realsoftware.com
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=chickensys.com; h=Received:X-Mailer:Date:To:From:Subject:In-Reply-To:References:Mime-Version:Content-Type:X-Identified-User; b=eF7+mT8A7+xJs+Yvh3x5dMWwU+/rjtOWxPMaft84mJoFkIq222/YnIJmsS8dVrYfP6oUj+KBfmVekT/rsiKjV08EakhCciMLMTRX9UXUQUttecxUeGKVXUGh2diWS4e6;
Domainkey-status: unknown
In-reply-to: <49FA1514.9010509@inspiringapps.com>
References: <EFBD2814-7A6E-48B3-B747-ECBF3EF95BFA@oofile.com.au> <1iyzxxl.1a86lsfrb63cuM%realbasiclists@monkeybreadsoftware.de> <20090430204234.5B531427E9B4@mail.flattopinc.com> <49FA1514.9010509@inspiringapps.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
At 04:16 PM 4/30/2009, you wrote:

> Let's say I have a FolderItem in RB, and I have a dylib written in C++
> that calls the POSIX function lstat() (or stat()) to verify the
> existence of the file.

Er... can we stop here and explore why you're going to such great
lengths?  What does lstat or stat do for you that, say, .Exists does not?

Before I answer that, I want to say thanks for your great Encoding article and I did read it...

It's because I have many functions in this dylib and that needs to be self-sufficient. This question is actually a C++/XCode question in disguise as a RB question.

-I take the AbsolutePath of the folder item

Yikes. If you do invoke a Unix routine, I would expect it to want a ShellPath, not an AbsolutePath.

Either way. I actually deal with this in another sort of way, but I omitted it for brevity.

What does get passed is a UNIX-style path, I change it along the way. It truly is the trademark symbol that gets in the way, because if I do the exact same thing to a file where the trademark is NOT involved, it works.

But again, that's not my question. What is my question is how lstat() is behaving.

And I have no idea what encoding it would want... probably whatever's stored on the operating system, but that could be almost anything.

How would you work around such a problem? (Shorter ways are preferred)

I think an overriding solution would be:

1) Take a FolderItem in RB and create a corresponding FSRef in C++, and vis-versa 2) Have a light/barebones FolderItem implementation, for now ..Child(), .Parent(), and .Exists()

Embarrassingly, I use paths in my C++ coding, and I know that's bad, but at the time I had no option (for me). So these things bite me.

I'd asked this question back, and I got an answer similar to "use the RB plugin SDK" but that didn't make any sense to my little brain so I dropped it. But I really should embrace it - so, can the FolderItem class be exposed/created for C++, and how is that done?

And, just to close, would this truly solve my core problem that was asked?

* * * * * * * * * * * * * * * * * * * * * * * * * * *
| Garth Hjelte                                      |
| Customer Service Representative, President        |
| Chicken Systems, Inc, Rubber Chicken Software Co. |
| 714 5th Street SE                                 |
| Willmar, MN 56201 USA                             |
|                                                   |
| 800-8-PRO-EPS    Toll Free Order Line (US Only)   |
| 320-235-9798     Tech Support, Sampler Questions  |
|                  International Line               |
| 360-838-7689     Fax                              |
| Product Sales:   sales@chickensys.com             |
| Product Support: support@chickensys.com           |
| Sampler Q+A:     qa@chickensys.com                |
| Web Page:        www.chickensys.com               |
* * * * * * * * * * * * * * * * * * * * * * * * * * *


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>