Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

GetSaveInfo and Alias files (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: Reports
Next thread: Linux Distribution


Re: ConsoleApp and ServiceApp   -   Rubber Chicken Software Co.
  GetSaveInfo and Alias files   -   Ron Benditt
   Re: GetSaveInfo and Alias files   -   David Glass
   Re: GetSaveInfo and Alias files   -   Ron Benditt
   Re: GetSaveInfo and Alias files   -   Ron Benditt
   Re: GetSaveInfo and Alias files   -   Arnaud Nicolet
   Re: GetSaveInfo and Alias files   -   Norman Palardy
   Re: GetSaveInfo and Alias files   -   David Glass
   Re: GetSaveInfo and Alias files   -   Ron Benditt

GetSaveInfo and Alias files
Date: 03.08.09 03:58 (Sun, 2 Aug 2009 19:58:41 -0700)
From: Ron Benditt
If I save the GetSaveInfo string from an alias file and then later try
to re-create the alias file from this string, I don't get a reference
to the original alias file; I get a reference to the file that the
alias points to instead. How can I save and retrieve a reference to
the alias file itself?

This is what I'm doing now:

theEncodedFileName
àcodeBase64(theAliasFile.GetSaveInfo(ApplicationDocumentsFolder,1))

Dim test As FolderItem
test=GetFolderItem(DecodeBase64(theEncodedFileName))

When this is run, "test" ends up being the file that "theAliasFile" is
pointing to. Is there any way to get a reference to the original
alias file rather than the file that is being pointed to using
GetSaveInfo?

Thanks,

Ron Benditt
Alien Apparatus Company, Inc.
http://www.alienapparatus.com


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

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

Re: GetSaveInfo and Alias files
Date: 03.08.09 05:38 (Sun, 2 Aug 2009 21:38:57 -0700)
From: David Glass
You probably want the rather confusingly-named .TrueItem

On Aug 2, 2009, at 7:58 PM, Ron Benditt wrote:

> Is there any way to get a reference to the original alias file
> rather than the file that is being pointed to using GetSaveInfo?
>
> Thanks,
>
> Ron Benditt

Re: GetSaveInfo and Alias files
Date: 04.08.09 22:29 (Tue, 4 Aug 2009 14:29:16 -0700)
From: Ron Benditt
> When you write out the data you write out an alias (correct ?)
> Accessing that alias RB will try to resolve it to the original file
> referenced by the alias
> That's by design

Thanks Norman, that's what I thought. I just wanted to make sure that
I wasn't missing something obvious.

> You might have to grab the parent.trueitem(i) that is your alias file
> to refer to the alias itself


Yes, that's how I get the alias file reference to begin with. But
then I want to save the folderitem reference to a preferences file, so
I use GetSaveInfo to generate the string. But it appears that there is
no really good way of retrieving the file back from the preferences if
its an alias.

This being said, I have managed to get things working in my particular
case, but not in a generic way. In my app, I know what the parent
folder should be, and if the file that I regenerate from the
preferences is not in this folder, then I know that the file could be
an alias file, so then I look in the parent folder for each trueItem
and Item. If the item is the same as the file that was regenerated
from the preferences, then I know that it was really the trueItem that
I wanted all along. What a workaround! Good thing that I know what
the parent folder is or I could really be stuck.

Regards,

Ron Benditt
Alien Apparatus Company, Inc.
http://www.alienapparatus.com

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

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

Re: GetSaveInfo and Alias files
Date: 04.08.09 22:12 (Tue, 4 Aug 2009 14:12:22 -0700)
From: Ron Benditt
> Since you have, in fact, used TrueItem
> already, then this would seem like a bug, as the GetSaveInfo should
> (it seems to me) be storing the info for the alias.

Yes, I would think so also. Thanks for your help though; its good to
know that I wasn't doing something wrong.

Regards,

Ron Benditt
Alien Apparatus Company, Inc.
http://www.alienapparatus.com

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

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

Re: GetSaveInfo and Alias files
Date: 03.08.09 23:01 (Tue, 04 Aug 2009 00:01:43 +0200)
From: Arnaud Nicolet
Le 3 août 09 à 23:56, Norman Palardy a écrit:

> On 3-Aug-09, at 2:04 PM, Ron Benditt wrote:
>
>>> You probably want the rather confusingly-named .TrueItem
>>
>> How can this help me? Maybe I don't understand.
>>
>> I have a folderitem reference that I got using TrueItem and the
>> folderitem's alias property is True, so I do in fact have the
>> proper file to start with. Then I save its information to a
>> string using GetSaveInfo. Now when I regenerate the folderitem
>> from the string, I get the file that was pointed to, rather than
>> the "TrueItem". How can I get the TrueItem in this circumstance?
>
> When you write out the data you write out an alias (correct ?)
> Accessing that alias RB will try to resolve it to the original file
> referenced by the alias
> That's by design
>
> You might have to grab the parent.trueitem(i) that is your alias
> file to refer to the alias itself

It may be a good idea to have GetRelative with a new parameter
(ResolveAlias As Boolean), which defaults to true (to not break
existing code) and, if false, does not try to resolve the alias.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

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

Re: GetSaveInfo and Alias files
Date: 03.08.09 22:56 (Mon, 3 Aug 2009 15:56:46 -0600)
From: Norman Palardy

On 3-Aug-09, at 2:04 PM, Ron Benditt wrote:

>> You probably want the rather confusingly-named .TrueItem
>
> How can this help me? Maybe I don't understand.
>
> I have a folderitem reference that I got using TrueItem and the
> folderitem's alias property is True, so I do in fact have the proper
> file to start with. Then I save its information to a string using
> GetSaveInfo. Now when I regenerate the folderitem from the string,
> I get the file that was pointed to, rather than the "TrueItem". How
> can I get the TrueItem in this circumstance?

When you write out the data you write out an alias (correct ?)
Accessing that alias RB will try to resolve it to the original file
referenced by the alias
That's by design

You might have to grab the parent.trueitem(i) that is your alias file
to refer to the alias itself


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

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

Re: GetSaveInfo and Alias files
Date: 03.08.09 22:37 (Mon, 3 Aug 2009 14:37:30 -0700)
From: David Glass

On Aug 3, 2009, at 1:04 PM, Ron Benditt wrote:

>> You probably want the rather confusingly-named .TrueItem
>
> How can this help me? Maybe I don't understand.
>
> I have a folderitem reference that I got using TrueItem and the
> folderitem's alias property is True, so I do in fact have the proper
> file to start with. Then I save its information to a string using
> GetSaveInfo. Now when I regenerate the folderitem from the string,
> I get the file that was pointed to, rather than the "TrueItem". How
> can I get the TrueItem in this circumstance?
>

Not sure that it can. I saw no reference to TrueItem in your original
post, so assumed you had not used it which would have explained the
'incorrect' GetSaveInfo. Since you have, in fact, used TrueItem
already, then this would seem like a bug, as the GetSaveInfo should
(it seems to me) be storing the info for the alias.

Re: GetSaveInfo and Alias files
Date: 03.08.09 21:04 (Mon, 3 Aug 2009 13:04:39 -0700)
From: Ron Benditt
> You probably want the rather confusingly-named .TrueItem

How can this help me? Maybe I don't understand.

I have a folderitem reference that I got using TrueItem and the
folderitem's alias property is True, so I do in fact have the proper
file to start with. Then I save its information to a string using
GetSaveInfo. Now when I regenerate the folderitem from the string, I
get the file that was pointed to, rather than the "TrueItem". How can
I get the TrueItem in this circumstance?

Regards,

Ron Benditt
Alien Apparatus Company, Inc.
http://www.alienapparatus.com

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

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