yortus/DBFFile

Memo file not found for file '${path}'

Acry opened this issue · 3 comments

Acry commented

Hi all,

thanks for the work so far.

If have an issue regarding case-sensititvity of input files:
Unfortuneatly I have 2 cases of filenames:

table1.dbf
table1.dbt

TABLE2.DBF
TABLE2.DBT

But I can't copy or mutate clients data.

Currently I just patched the package:

if (fileVersion === 0x83 || fileVersion === 0x8b) {
    memoPath = path.slice(0, -path_1.extname(path).length) + '.dbt';
    let isMemoFileMissing = await utils_1.stat(memoPath).catch(() => 'missing') === 'missing';
    if (isMemoFileMissing){
        memoPath = path.slice(0, -path_1.extname(path).length) + '.DBT';
        isMemoFileMissing = await utils_1.stat(memoPath).catch(() => 'missing') === 'missing';
    }
    if (isMemoFileMissing)
        memoPath = undefined;

Any better solutions?

Regards,
Acry

Hmm interesting. This probably went unnoticed since Windows and MacOS file systems are case-insensitive (but case-preserving). Are you running on linux by chance?

I'm not sure there's a better way other than trying both the uppercase and lowercase variants as you have done above, although I'd probably iterate over ['.dbt', '.DBT'] rather than copying the whole code twice.

Hi @Acry, I've merged a change to address this issue in the latest version (v1.7.1). Can you try it out and see if the problem is fixed?

Acry commented

Sorry for the late response. Emails got eaten by flood =)

All issues are resolved.

Yeah, I'am running arch-linux.

Ofc your code is way more elegant. Only did the duplication to make changes more obvious.

Thank you