mirror of
https://gitlab.com/eql/lqml.git
synced 2026-01-15 05:41:13 -08:00
example 'cl-repl': android: ensure write permission of copied asset files
This commit is contained in:
parent
7985485fbf
commit
3d32e2c259
2 changed files with 7 additions and 8 deletions
|
|
@ -623,7 +623,12 @@ cl_object qcopy_file(cl_object l_from, cl_object l_to) {
|
|||
/// Convenience function for android, for e.g. copying files from 'assets:/',
|
||||
/// which can't be accessed directly from Lisp.
|
||||
/// (qcopy-file "assets:/lib/asdf.fas" "asdf.fas")
|
||||
bool ok = QFile::copy(toQString(l_from), toQString(l_to));
|
||||
QString to(toQString(l_to));
|
||||
bool ok = QFile::copy(toQString(l_from), to);
|
||||
#ifdef Q_OS_ANDROID
|
||||
// copied asset files are read-only by default
|
||||
QFile::setPermissions(to, QFile::permissions(to) | QFileDevice::WriteOwner);
|
||||
#endif
|
||||
ecl_return1(ecl_process_env(), ok ? ECL_T : ECL_NIL);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue