login about faq

Are there any known issues with CkDirTree (C++) on Centos 7? I'm attempting to use Chilkat in the same fashion I always had before (same codebase), but I'm now failing on the BeginIterate() step when using CkDirTree. No error code or text is returned (even with VerboseLogging enabled), so I'm not entirely sure how to debug it.

I've verified the directory exists and that permissions are such that I should be able to peruse the directory. strace didn't reveal any obvious answers either.

asked Jan 24 at 14:05

kevin's gravatar image

kevin
11

edited Jan 24 at 14:06


I'm not aware of anything. Are you using the 64-bit or 32-bit lib? I can add information to the LastErrorText to help (and post a pre-release download)..

link

answered Jan 24 at 17:26

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

32-bit lib on 64-bit OS. Which was a bit tricky since 64-bit CentOS doesn't come shipped with 32-bit shared libraries by default.

Performing the directory iteration via the standard opendir/readdir() APIs seemed to work just fine.

(Jan 24 at 18:25) kevin

The 32-bit and 64-bit "Linux" downloads at http://www.chilkatsoft.com/chilkatLinux.asp are for RHEL, CentOS, etc. The 32-bit RHEL4 download is just for an old version of RHEL.

There should be no need for you to use it. Just use the 64-bit Linux build on CentOS.

link

answered Jan 24 at 18:33

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

It's a 32-bit binary (specifically compiled with the -m32 flag). I can't use 64-bit libraries with it

(Jan 24 at 18:39) kevin

I looked at the internals, and I think the only information needed is the value of the BaseDir property. Verify that you're setting it to what you expect..

for example:

dirTree.put_BaseDir("/something/abc/123");
or.. if you pass a relative path to put_BaseDir, then make sure you know the actual value of your current working directory. If it's not what you expect...

link

answered Jan 24 at 19:52

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

Here's my comparable results on a Centos 7 64-bit machine and a Xubuntu 16.04 32-bit machine (as mentioned before, lastErrorText doesn't provide any useful details on the Centos box...I just noticed I forgot to add that to my test program): XUBUNTU 16.04 LTS, 32-bit


root@alpha(10.1.10.19) : ~/test_dir $ cat test.cpp

include "CkDirTree.h"

include <stdio.h>

int main() { CkDirTree dirtree; CkString base_dir;

dirtree.get_BaseDir(base_dir);
dirtree.put_Recurse(false);

printf("basedir is %s\n",base_dir.getString());

if (dirtree.BeginIterate() == false) {
    printf("failure\n");
}

while (dirtree.get_DoneIterating() != true) {
    const char *rel_path;

    rel_path = dirtree.relativePath();
    printf("file: %s\n",rel_path);
    if (dirtree.AdvancePosition() == false) {
        if (dirtree.get_DoneIterating() != true) {
            printf("failure2\n");
        }
    }
}
return 0;

}

root@alpha(10.1.10.19) : ~/test_dir $ g++ -m32 test.cpp -lchilkat-9.5.0 -lpthread -I./chilkat/chilkat-9.5.0-x86-linux-gcc/include -L.

root@alpha(10.1.10.19) : ~/test_dir $ ./a.out

basedir is /root/test_dir

file: a.out

file: .

file: libchilkat-9.5.0.a

file: chilkat

file: test.cpp

file: ..

file: testpackage.tar

root@alpha(10.1.10.19) : ~/test_dir $ ls

a.out chilkat libchilkat-9.5.0.a test.cpp testpackage.tar

root@alpha(10.1.10.19) : ~/test_dir $

CENTOS 7, 64-bit

root@localhost(10.1.0.106) : ~/test_dir $ cat test.cpp


#include "CkDirTree.h"
#include <stdio.h>

int main() {
    CkDirTree dirtree;
    CkString base_dir;

dirtree.get_BaseDir(base_dir);
    dirtree.put_Recurse(false);

printf("basedir is %s\n",base_dir.getString());

if (dirtree.BeginIterate() == false) {
        printf("failure\n");
    }

while (dirtree.get_DoneIterating() != true) {
        const char *rel_path;

rel_path = dirtree.relativePath();
        printf("file: %s\n",rel_path);
        if (dirtree.AdvancePosition() == false) {
            if (dirtree.get_DoneIterating() != true) {
                printf("failure2\n");
            }
        }
    }
    return 0;
}
root@localhost(10.1.0.106) : ~/test_dir $ g++ -m32 test.cpp -lchilkat-9.5.0 -lpthread -I./chilkat/chilkat-9.5.0-x86-linux-gcc/include/ -L.

root@localhost(10.1.0.106) : ~/test_dir $ ./a.out

basedir is /root/test_dir

failure

root@localhost(10.1.0.106) : ~/test_dir $ ls

a.out chilkat libchilkat-9.5.0.a test.cpp testpackage.tar

root@localhost(10.1.0.106) : ~/test_dir $

link

answered Jan 25 at 11:24

kevin's gravatar image

kevin
11

Thanks, I'll give it a test..

link

answered Jan 25 at 12:33

chilkat's gravatar image

chilkat ♦♦
12.8k317363471

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×118

Asked: Jan 24 at 14:05

Seen: 423 times

Last updated: Jan 25 at 12:33

powered by OSQA