[V4RB] BLOB problems
Ruslan Zasukhin
sunshine at public.kherson.ua
Tue Nov 1 21:48:26 CST 2005
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??
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list