MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Sigil 1.8 will only run in a specific folder (https://www.mobileread.com/forums/showthread.php?t=342613)

KevinH 11-02-2021 06:12 PM

Okay, tracked this down to FolderKeeper::AddContentFileToFolder and specifically to this line.

QFile::copy(fullfilepath, new_file_path);

So it appears that copying "permissions" must be a "feature" of Qt's QFile::copy() but only for non html text files. html text files are handled by the Importer code which does not use QFile::copy.

We can of course rewrite this to do a text based file read and destination file write if we determine the filetype is in fact text and not binary.

I will look into it.

KevinH 11-02-2021 06:15 PM

It appears according to this, the permissions are indeed copied but this is not documented anyplace in the Qt QFile docs!

https://stackoverflow.com/questions/...he-copied-file

BetterRed 11-02-2021 06:25 PM

1 Attachment(s)
FWIW: my experience is that when a file is copied from one directory to another on a Windows/NTFS system the file in the target destination will retain attributes such as System, Hidden, and Read Only. The new file will have its Archive bit set and its Create timestamp will be set to when it was created, i.e. the time of copying it.

And on Windpws/NTFS file and directory attributes and permissions are not synonymous.

KevinH 11-02-2021 06:25 PM

As it turns out we make lots of use of QFile::copy internally in Utility.cpp so we fill need to set Owner, User, and Other to be RW for our internal temp files by using QFile's static setPermissions routine right in AddContentToFolder as all of these temp files may be editable by OpenWith.

The fix has now been added to master and will appear in the next release.

Thank you for your bug report and persistence to get it fixed.

DiapDealer 11-03-2021 12:01 PM

Definitely seems to do the trick for me. Thanks for tracking it down and fixing it.


All times are GMT -4. The time now is 05:54 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.