iOS Question B4i - Sqlite

Discussion in 'iOS Questions' started by daniedb, Jul 4, 2015.

Similar threads

B4i Tutorial Files and Folders
B4i Tutorial Reading and Writing PDF Documents
B4i Question DB3 not working in release?
B4i Question Record TTS output to file
B4i Question file.dirDocuments
  1. daniedb

    daniedb Active Member Licensed User

    Hi Guys
    This got me puzzling for the last 2 hours, and can get it sorted

    In my one B4i App this works 100%

    Code:
    Dim localdb As String  :localdb="gsm/data/gsm.db"
      
    File.MakeDir(File.DirDocuments,"gsm/data")
       
    If File.Exists(File.DirDocuments,"gsm/data/gsm.db") = False Then
         
    File.Copy(File.DirAssets,"gsm.db",File.DirDocuments,localdb)
         
    Log("cannot find db, copy")
       
    Else
         
    Log("find db, ")
       
    End If
    In a second app, it don't work

    Code:
    Dim localdb As String  :localdb="MyApp/data/wlife.db"
      
    File.MakeDir(File.DirDocuments,"MyApp/data")

       
    If File.Exists(File.DirDocuments,"MyApp/data/wlife.db") = False Then
         
    File.Copy(File.DirAssets,"wlife.db",File.DirDocuments,localdb)
         
    Log("cannot find db, copy")
       
    Else
         
    Log("find db, ")
       
    End If
    Ive confirmed that the wlife.db is in the files folder of this project

    Code:
    Error copying file: Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)" UserInfo=0x165f20a0 {NSSourceFilePathErrorKey=/private/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/tmp/virtual_assets/wlife.db, NSUserStringVariant=(
      Copy
    ), NSFilePath=/
    private/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/tmp/virtual_assets/wlife.db, NSDestinationFilePath=/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/Documents/leznad/wildMang/data/wlife.db, NSUnderlyingError=0x165f18c0 "The operation couldn’t be completed. No such file or
    Please advice, thanks, Appreciate
    Danie
     
  2. daniedb

    daniedb Active Member Licensed User

    Ok, this is now starts to freak me out :)
    3Rd Time a Post a Question, after struggling for a few hours, and once posted, I see something and change it
    <solved, HOW>
    I've changed the paths to lowercase and it works.
    Never realize that Apple require lower case..

    Maybe someone else learn out of my stupid mistakes...

    Cherio
    D
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Not that Android file system is also case sensitive.
     
Loading...