Sunday, 2 June 2013

why is my program unable to access it's required files files?

why is my program unable to access it's required files files?

i have written a program using Qt libraries for an embedded device that runs on Linux generated by Buildroot. To start my program i've created a script called S80custom and placed it in /etc/init.d/ directory. the content of the script is:
#!/bin/sh

if [ ! -d "/root/files/" ]; then
    mkdir /root/files/
fi

if [ ! -d "/root/Test/" ]; then
    mkdir /root/Test/
fi

if [ ! -d "/root/Test/Log/" ]; then
    mkdir /root/Test/Log/
fi

export TSLIB_CONSOLEDEVICE='none'
export TSLIB_FBDEVICE='/dev/fb0'
export TSLIB_TSDEVICE='/dev/input/event1'
export TSLIB_PLUGINDIR='/usr/lib/ts'
export TSLIB_CONFFILE='/etc/ts.conf'
export TSLIB_CALIBFILE='/etc/pointercal'
export QWS_MOUSE_PROTO=tslib:'/dev/input/event1'

/root/Test/Test -qws
however when my program runs at system start-up it can't access the files placed at /root/files. I've used QFile class and it's member functions for the same. I’ve tried Standard C++ Libraries and they work but strangely QFile is unable to open the files and i must use QFile for this task. what am i doing wrong here?
i should also mention here that when i run my application from command prompt after i login, it works perfectly...

No comments:

Post a Comment