GetSaveInfo/GetFolderItem not working on external drives

I have discovered some strange/unexpected behavior with GetSaveInfo and am wondering if anyone else has had this problem or can offer a workaround.

I am working on a project that manages a list of files. I need to save/load this list, so I save the encoded GetSaveInfo string for each file and use GetFolderItem to retrieve it.

Everything works correctly when the files are located on my hard drive. If a file is renamed or moved on my hard drive, GetFolderItem is still able to successfully find it. However, if the file is located on an external hard drive or flash drive, it no longer works. If the file is originally saved on the hard drive and then moved (not copied) to the external drive, it also doesn’t work.

I am passing “nil” to GetSaveInfo and do not specify a mode, as in…

// Save Dim SaveString as String = EncodeBase64( FileToSave.GetSaveInfo(nil) ) // Load Dim MyFile as FolderItem = GetFolderItem( DecodeBase64(StringSave) )

Is this correct? Does it have something to do with how my external drives are formatted or journaled?

Close Xojo, locate its Cache folder and clear its contents, then re-run Xojo and make testings.

Xojo Cache folder is:
<user_name>/Library/Caches/Xojo/

Also:
I too suffer from many diseased with Xojo (usually on OS X) and strange things. These does appears with or/and without external hard disk(s).

At last, I moved my project(s) into the internal boot SSD and still have troubles.

BTW: What are your OS X and Xojo versions ?

[quote=266618:@Emile Schwarz]Close Xojo, locate its Cache folder and clear its contents, then re-run Xojo and make testings.

Xojo Cache folder is:
<user_name>/Library/Caches/Xojo/[/quote]

Thanks for your suggestion, Emile. Clearing the cache did nothing :frowning:

I was afraid someone might ask… 10.9.5 and 2015r2, respectively. I’m always reluctant to upgrade because I’m paranoid about losing data, though I recently started regularly backing up with Time Machine.

Still, I’d be surprised if old versions were the culprits in this case, but I’ve been wrong before!

(I also just noticed that the pseudo code in my OP should read SaveString in both instances, not StringSave. That’s not the issue; as I mentioned, the code works correctly for files on the hard drive!)

Us there, in the file path, a non ASCII character ?

Now that some hours ellapsed, I recall that.

[quote=266681:@Emile Schwarz]Us there, in the file path, a non ASCII character ?

Now that some hours ellapsed, I recall that.[/quote]

Nope. Just basic A-Z characters. And the external drives I’m using have basic names, too (“Main”, “Data”, etc).

Maybe it relates to the disc format of the external drive - I can’t remember exactly but does the Mac still use HFS+, or ‘Mac OS Extended (Journaled)’ or some such, while many flash sticks and external drives are FAT32 or NTFS ( or even FAT16 LOL! ). Maybe your files are named so that the disc format does not like them. Also, FAT32 does not like files > 2GB. Either that or a rights issue.

If you format a flash stick the Mac way, does it then work?

Or maybe on Mac, it being Unix, you have to specify a complex path to the mount point. Maybe iterate the Volumes and make ‘child’ moves.

( Then again I tend to make a fool of myself trying to answer Mac questions - sorry if I am off the right path ).

[quote=266683:@Peter Job]Maybe it relates to the disc format of the external drive - I can’t remember exactly but does the Mac still use HFS+, or ‘Mac OS Extended (Journaled)’ or some such, while many flash sticks and external drives are FAT32 or NTFS ( or even FAT16 LOL! ). Maybe your files are named so that the disc format does not like them. Also, FAT32 does not like files > 2GB. Either that or a rights issue.

If you format a flash stick the Mac way, does it then work? […][/quote]

Now this is curious. After reading your post, I thought I might experiment a little with the drive formatting, since that’s been my suspicion as well. Here are the results:

Main hard drive: Formatted with “Mac OS Extended (Journaled)”. GetSaveInfo/GetFolderItem work correctly.

External hard drive: Two partitions, both formatted “Mac OS Extended (Journaled)”. GSI/GFI do not work.

USB flash stick #1: Formatted “Mac OS Extended (Journaled)”. GSI/GFI do not work.

USB flash stick #2: Re-formatted to “Mac OS Extended (Journaled)”. GSI/GFI DO work (?!?!?)

USB flash stick #3: Formatted FAT32, GSI/GFI do not work. Re-formatted to “Mac OS Extended (Journaled)”. GSI/GFI now work.

This just seems bizarre to me! Some drives work, some don’t.

[quote=266693:@Matthew Pool]

This just seems bizarre to me! Some drives work, some don’t.[/quote]

Yikes!!!

Maybe look at owner/permissions of the volumes and root folders, and GSI/GFI folders.

( A bit like when I copied my ‘My Documents’ folder to another PC recently, and I had to ‘take ownership’ of the folder on the new PC under Windows ).