So, I was fiddling around with RB's "Plugin Converter" (found in their plugin 
SDK).

I had this problem where it was adding these annoying .DS_Store files to my 
plugin. And then this confused RB, which copied a .DS_Store file to the... 
compiled RB app, instead of to my ElfData plugin!

So, I added this little line at the top of the PushIntoVirtualVolume function.

        if item.name.left(1) = "." then return // ths -- ignore .DS_Store

I also added this line near the bottom, to make it look nicer:

        print vvItem.ShellPath + "/" + item.Name // ths -- output helpful stuff

Now my function looks like this:


Private Sub PushIntoVirtualVolume(item as FolderItem, vvItem as FolderItem)
  if item.name.left(1) = "." then return // ths -- ignore .DS_Store
  
  if item.Directory then
    // If the item is a folder, then we want to create a folder in the
    // destination.
    dim babyItem as FolderItem = vvItem.Child( ConvertEncoding( item.Name, 
Encodings.UTF8 ) )
    babyItem.CreateAsFolder
    
    // Now loop over the children of the directory, and add them 
    // into the virtual volume as well
    dim count as Integer = item.Count
    for i as Integer = 1 to count
      PushIntoVirtualVolume( item.TrueItem( i ), babyItem )
    next i
  else
    // If the item is a file, then copy it over directly
    print vvItem.ShellPath + "/" + item.Name // ths -- output helpful stuff
    item.CopyFileTo( vvItem )
  end if
End Sub


This might be useful for someone who is making plugins and getting tripped up 
by those .DS_Store files. At the very least, maybe in a few months time someone 
will have this problem and do a google search for it and find it :)



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

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

Reply via email to