LiteDB是否在连接字符串中支持长文件名(> = 260个字符)

时间:2018-08-28 15:06:27

标签: system.io.file system.io.directory litedb

我使用litedb作为文件索引,从而重新创建文件共享的目录结构,并将litedb.db文件拖放到层次结构中的每个目录中。我遇到的问题似乎是目录结构长度超过260个字符的地方(请参见下面的错误消息)。连接到litedb时,是否有办法在连接字符串中启用对长文件名的支持?另外,还有一种方法可以使用其他方法(例如file.open AlphaFS)实例化litedb实例。

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.sqaureup.retrofit2:retrofit:2.3.0'
    implementation 'com.sqaureup.retrofit2:converter-gson:2.3.0'
}

1 个答案:

答案 0 :(得分:0)

LiteDB使用FileStream ctor打开数据文件,因此长路径可能是一个问题。但是,您可以将Stream用作数据库的初始化程序,以便可以在任何平台上打开。