Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-01-2021, 05:23 PM   #31
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
File systems you read and write from also need the windows equivalent of execute permissions on the folder holding those files to even access the files in the directory. So your explanation does not explain why Sigil could not write its empty epub file using file save-as. The privs on the output folder must be messed up as well.

You have to intentionally set files to read-only. Virtually no one does that. If you had just said that at the beginning this would have been diagnosed quickly.
KevinH is offline   Reply With Quote
Old 11-01-2021, 05:47 PM   #32
Domenick
Member
Domenick began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Device: none
I apologize. Setting important files to read-only ensures I do not change them without creating a new version, thereby invalidating existing dependencies.

It was my standard novel CSS file which had not changed in years. It did not occur to me to check if the file was read-only, which begs the question, why would a read-only CSS file cause this behavior? Sigil could still read it, and Sigil had no reason to alter or write over the file.

Again, thank you.
Domenick is offline   Reply With Quote
Advert
Old 11-01-2021, 06:01 PM   #33
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
Sigil works just fine with Adding Files that are set to read-only in directories with execute permission that the user owns. I just tested this on macOS and Linux. No crashes. I do not have a Windows box to test with that but I would guess it works there as well. I think the act of changing files to be read-only either changed owner or changed the folder's permissions which explains why Sigils epub save-as could not write to that folder.

So this is either a Window's specific thing or Windows permissions on the folder enclosing the the read-only file are incorrect on your machine.

Glad to hear you figured out what was wrong with your permissions. This is not a bug in Sigil at least on Linux and MacOS.

@DiapDealer when you get a free moment would you please test using AddExisting on a file that the user owns that is set to read-only on your Windows build to determine if there is any Sigil issue at all on Windows?




Quote:
Originally Posted by Domenick View Post
I apologize. Setting important files to read-only ensures I do not change them without creating a new version, thereby invalidating existing dependencies.

It was my standard novel CSS file which had not changed in years. It did not occur to me to check if the file was read-only, which begs the question, why would a read-only CSS file cause this behavior? Sigil could still read it, and Sigil had no reason to alter or write over the file.

Again, thank you.
KevinH is offline   Reply With Quote
Old 11-02-2021, 02:39 PM   #34
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,710
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
@DiapDealer when you get a free moment would you please test using AddExisting on a file that the user owns that is set to read-only on your Windows build to determine if there is any Sigil issue at all on Windows?
Just noticed this. Will do.
DiapDealer is offline   Reply With Quote
Old 11-02-2021, 03:03 PM   #35
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,710
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I can't get Sigil to crash when adding an existing file to Sigil that is marked as read-only (but otherwise, my user has full-control of the folder where the read-only file resides). But strangely enough, Sigil DOES crash when trying to save an epub to which a read-only file was added (Add Existing). But it doesn't matter if the epub is trying to be saved back to that same folder or not. It will crash wherever it's saved.

I can confirm that the added read-only file is also read-only in Sigil's scratch directory after it's added.

My guess would be a flush to disk call before saving the epub is failing because of that read-only status. Sigil just flat-out crashes when saving any epub (anywhere) that has a read-only file in Sigil's scratch area.

The new empty epub never actually gets saved, so I doubt the crash is the result of trying to clean up the tmp dir afterward.
DiapDealer is offline   Reply With Quote
Advert
Old 11-02-2021, 03:15 PM   #36
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,710
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Woah... weird! So far, it seems to be limited to read-only css files, if you can believe it. There may be a bug here after all! I just repeated the experiment with adding a read-only xhtml file and it appears in Sigil's scratch directory with the read-only property unset! An no crash when saving.

Why would a css file's read-only attribute get copied when an xhtml file's isn't?

But to be clear... a read-only file in Sigil's scratch directory is what's causing Windows to crash when saving an epub (when saving it anywhere).
DiapDealer is offline   Reply With Quote
Old 11-02-2021, 03:21 PM   #37
Domenick
Member
Domenick began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Apr 2020
Device: none
Quote:
Originally Posted by DiapDealer View Post
I can't get Sigil to crash when adding an existing file to Sigil that is marked as read-only (but otherwise, my user has full-control of the folder where the read-only file resides). But strangely enough, Sigil DOES crash when trying to save an epub to which a read-only file was added (Add Existing). But it doesn't matter if the epub is trying to be saved back to that same folder or not. It will crash wherever it's saved....
This is precisely the behavior I experienced. Try adding the read-only CSS file, then the HTML file. Does Sigil crash during the HTML add?
Domenick is offline   Reply With Quote
Old 11-02-2021, 03:31 PM   #38
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,710
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Domenick View Post
This is precisely the behavior I experienced. Try adding the read-only CSS file, then the HTML file. Does Sigil crash during the HTML add?
Yes it does. Without a warning message.

That supports my flush-to-disk theory (which would happen before the xhtml file is subsequently added), but doesn't explain why only the css file-type (so far) is keeping it's read-only attribute after being added to Sigil on Windows.
DiapDealer is offline   Reply With Quote
Old 11-02-2021, 04:22 PM   #39
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
If you use AddExisting to add an html file that is properly linked to a css file that can be found properly relative to it, that css file will be imported as well ... ditto for images resources.

The question is why/how is the copy of the css file inside Sigil's temp folder somehow getting set to read only? It should be reading the contents of the css file and writing it out to temp, not copying permissions.
KevinH is offline   Reply With Quote
Old 11-02-2021, 04:57 PM   #40
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
I can recreate this on macOS. When I previously tried to recreate it , I was making the html file read only and that had no impact. All worked fine. This time I tried adding a read only css file and got a std exception.

Since I can now recreate this (but only with a css file) I can try to track it down as well.
KevinH is offline   Reply With Quote
Old 11-02-2021, 05:12 PM   #41
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
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 is offline   Reply With Quote
Old 11-02-2021, 05:15 PM   #42
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
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
KevinH is offline   Reply With Quote
Old 11-02-2021, 05:25 PM   #43
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,776
Karma: 27405072
Join Date: Mar 2012
Location: Sydney Australia
Device: none
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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2021-11-03 081200.jpg
Views:	114
Size:	59.9 KB
ID:	189991  

Last edited by BetterRed; 11-02-2021 at 05:28 PM.
BetterRed is offline   Reply With Quote
Old 11-02-2021, 05:25 PM   #44
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
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.

Last edited by KevinH; 11-02-2021 at 07:00 PM.
KevinH is offline   Reply With Quote
Old 11-03-2021, 11:01 AM   #45
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,710
Karma: 196949708
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Definitely seems to do the trick for me. Thanks for tracking it down and fixing it.
DiapDealer is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Calibre/Kobo] Send some format (pdf, cbz) in specific folder? jedineofr Conversion 0 08-03-2020 10:39 AM
Send PDFs to a specific folder Aerandir14 Calibre 0 06-07-2017 11:41 AM
Sigil is Installed, But It Will Not Run RickMarx Sigil 13 06-20-2016 08:57 PM
user defined device: send items to specific folder fekhner Devices 9 10-06-2011 11:20 AM
How Run Sigil?! Lynda Benham Sigil 1 02-02-2010 06:37 AM


All times are GMT -4. The time now is 07:43 AM.


MobileRead.com is a privately owned, operated and funded community.