Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create data folder automatically if it does not exist #32

Open
mxmlnkn opened this issue May 1, 2020 · 1 comment
Open

Create data folder automatically if it does not exist #32

mxmlnkn opened this issue May 1, 2020 · 1 comment

Comments

@mxmlnkn
Copy link

mxmlnkn commented May 1, 2020

First, thanks for your work! I used ZKanji a long time on Windows and even a while using wine under Linux but after the last Linux reinstall and because I'm now also a Qt developer, I wanted to give building this Qt version from source a try. I especially like and frequently use the freehand drawing kanji lookup and that it comes with a built-in Japanese IME for the dictionary lookup.

I followed the build instruction like this:

git clone https://github.com/z1dev/zkanji.git
cd zkanji
mkdir build
cd build
qmake ../zkanji.pro
make

mkdir importfolder
cd importfolder
wget http://ftp.monash.edu/pub/nihongo/JMdict.gz
wget http://www.edrdg.org/kanjidic/kanjidic.gz
wget http://www.edrdg.org/kanjidic/kanjd212.gz
wget ftp://ftp.monash.edu/pub/nihongo/radkfile.gz
wget ftp://ftp.monash.edu/pub/nihongo/examples.utf.gz
for file in *gz; do
    gzip -d -k "$file"
done
cp ../dataimports/* .

# mkdir data # I forgot this and triggered the misleading error message
./zkanji -ie importfolder

No matter whether I choose portable or normal mode in the popup and no matter what permissions I set for the folder where zkanji resides in, I would always get this message:

File permissions do not allow creating and writing data files in the program's data folder.

Looking at the source code I found out that it checks whether the data folder is writable. But it never tries to check for its existence in the first place nor does it try to create it if it does not exist. Maybe I overlooked some of the instructions, but I think it would be easy to check and try to create the folder as fallback and do the permission check on the parent folder.

@z1dev
Copy link
Owner

z1dev commented Mar 28, 2021

Hi! Sorry for not writing before, but GitHub forgot to notify me of issues posted here apparently for a while now. I haven't seen multiple issues until now.

I'm not working on this project anymore. I wanted to make a full release and maybe add some small adjustments years ago, but for a long time nobody tested zkanji or reported issues, and I didn't want to make a full release of a possibly buggy program, then I moved on.

You are right, zkanji expects the data folder to be already created for it. This is an oversight. I'm not sure if I'll come back to zkanji to fix this (maybe on one weekend) so I can't promise anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants