Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline MBernacca  
#1 Posted : 20 February 2018 11:33:48(UTC)
MBernacca


Rank: Member

Groups: Registered
Joined: 28/11/2017(UTC)
Posts: 20
Italy
Location: Pisa

Was thanked: 2 time(s) in 2 post(s)
Hello to Everybody,

I just noted a strange behaviour of Smath, I am using release 99.6622 but I believe it is the same in other versions.
If you open a file on the fly (without downloading) from an external source (i.e.: Smath Forum) and then you make any change to it, when you close the file you are prompted with a request to save the file.
If you (improperly) answer "Yes", Smath crashes.
I think Smath is right in the sense that you shouldn't save to a read-only location, but for the sake of completeness, you might want to protect against improper use from inexperienced users... Good

Thanks for the attention
Marco

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 20 February 2018 12:30:46(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Grazie Marco Good

Bug confirmed (unhandled System.UnauthorizedAccessException).

Guess the right way is:
1) check for permissions
2) If permissions are denied, prompt the "save as" dialog;

Edited by user 20 February 2018 13:22:21(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Andrey Ivashov  
#3 Posted : 21 February 2018 09:51:39(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Hello, Davide.

I've made some improvements to saving logic. Please could you check the same scenario with latest sources?
Unfortunately I'm unable to reproduce this issue.

Thanks in advance!
Offline Davide Carpi  
#4 Posted : 21 February 2018 10:50:57(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Hello Andrey,

Not fixed with your improvements. To reproduce simply mark a file as readonly from the system file properties before opening it with SS.

In my sandbox folder there is a possible solution Good
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
thanks 1 user thanked Davide Carpi for this useful post.
on 21/02/2018(UTC)
Offline Jean Giraud  
#5 Posted : 21 February 2018 18:01:26(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: MBernacca Go to Quoted Post
Hello to Everybody,

I just noted a strange behaviour of Smath, I am using release 99.6622 but I believe it is the same in other versions.
If you open a file on the fly (without downloading) from an external source (i.e.: Smath Forum) and then you make any change to it, when you close the file you are prompted with a request to save the file.
If you (improperly) answer "Yes", Smath crashes.
I think Smath is right in the sense that you shouldn't save to a read-only location, but for the sake of completeness, you might want to protect against improper use from inexperienced users...

Thanks for the attention
Marco


Hello Marco,

Superb description, the missing link is that if you save from open on the fly,
good thing Smath crashes ... What ! Yes What, how Smath knows where to save ?
Back to originator ... no way. Why not Save as ...
Have you tried copy/paste on new sheet => Save as in some addressed location ?

Jean

Offline Davide Carpi  
#6 Posted : 21 February 2018 21:15:13(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,639
Man
Italy
Location: Italy

Was thanked: 1323 time(s) in 873 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
Yes What, how Smath knows where to save ?
Back to originator ... no way. Why not Save as ...


This is not a big deal, the file downloaded for reading is stored in a temporary path and flushed when you close the browser, Smath knows the path and since is a temp folder can write in it Good. But the downloaded file it is set as read-only and can't be overwritten (this is not handled, hence the crash); best way from my point of view is to simply prompt the "save as" dialog that is opened on the default location; this it works on any read-only file, and you can still get an error messsage from the system if you try to overwrite the file from within the dialog.

Edited by user 21 February 2018 21:19:58(UTC)  | Reason: Not specified

If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Andrey Ivashov  
#7 Posted : 21 February 2018 21:31:34(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
Thank you very much Davide!

I've taken your fix as a basis and extended it to support all possible places where saving to file may be called (i.e. desktop UI, silent mode, etc.). So, this is done now.

Best regards.
thanks 1 user thanked Andrey Ivashov for this useful post.
on 21/02/2018(UTC)
Offline Andrey Ivashov  
#8 Posted : 21 February 2018 22:29:06(UTC)
Andrey Ivashov


Rank: Administration

Groups: Developers, Registered, Knovel Developers, Administrators, Advanced Member
Joined: 11/07/2008(UTC)
Posts: 1,616
Man
Russian Federation

Was thanked: 1978 time(s) in 666 post(s)
FYI: Fix is a part of just released nightly build: https://en.smath.info/fo...6--21-February-2018.aspx

Edited by moderator 23 February 2018 02:39:10(UTC)  | Reason: marked as SOLVED

thanks 1 user thanked Andrey Ivashov for this useful post.
on 23/02/2018(UTC)
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.