[V4RB] BLOB problems

Ken Jordan jordan at digi-net.com
Tue Nov 1 15:10:46 CST 2005


Ruslan Zasukhin wrote:

>On 11/1/05 9:35 PM, "Ken Jordan" <jordan at digi-net.com> wrote:
>
>Hi Ken,
>  
>
>>I have a very small program to test storing and retrieving binary data
>>using a VBlob. (2.0.4 - OS X.3.9)
>>
>>app.open:
>>---------------
>>  Valentina.Init(10 * 1024 *1024)
>> 
>>  Valentina.DebugLevel = 3
>>  Valentina.ThrowExceptions = true
>>
>>
>>Window1.PushButton1.Action:
>>-------------------------
>>  dim f as FolderItem = GetFolderItem("vtest.vdb")
>>  if f.Exists then f.Delete()
>> 
>>  dim test_database as VDatabase = new VDatabase
>>  test_database.Create(f, 1, 32 * 1024, EVOs.kOSDefault )
>> 
>>  dim file_table as VTable = test_database.CreateTable("ftable")
>>  call file_table.CreateBLOBField( "file", 1024 )
>>    
>>
>
>Actually here should be also:
>  
>
>>  f = GetFolderItem("file.rar")
>>    
>>
>
>    file_table.SetBlank()
>
>>  file_table.BlobField("file").FromFile(f)
>>    
>>
>
>    file_table.AddRecord()
>
>NOW YOU HAVE record in table on disk.
>  
>
>>  f = GetFolderItem("saved_file.rar")
>>  file_table.BlobField("file").ToFile(f)
>> 
>>  test_database.Close()
>>  test_database = nil
>>
>>app.Close:
>>-----------------------
>>Valentina.Shutdown()
>>
>>file.rar is a 1.8 MB rar containing Valentina examples.
>>
>>Two problems:
>>1) "diff file.rar saved_file.rar" yields "Binary files file.rar and
>>saved_file.rar differ"
>>    
>>
>>    Stuffit will open file.rar, will not open saved_file.rar
>>2) Program crashes at test_database.Close()
>>
>>Any ideas what I am missing??
>>    
>>
Thanks, Ruslan.
That cures problem 2, but the files are still not the same. ???


More information about the Valentina mailing list