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

Files corrupted on sleep/wake #13

Open
fubar-1 opened this issue Mar 14, 2018 · 6 comments
Open

Files corrupted on sleep/wake #13

fubar-1 opened this issue Mar 14, 2018 · 6 comments
Assignees

Comments

@fubar-1
Copy link

fubar-1 commented Mar 14, 2018

Hi SelectCodeDE,

Stand-Bye is great! I have been using it for a few weeks and it's (*almost) exactly what I was looking for to get my computers to sleep at the appropriate time.

There's just one problem. It appears that if a file is held open in read/write mode by an app when the computer is put to sleep, that file may become corrupted.

I think the scenario you might need to address is when files are held open-write that reside on a network share. In my scenario the file was virtual disk residing on a file share on a local LAN server. But no worries I was able to restore the file from backup and didn't lose much. However I can't continue to use Stand-Bye until this issue is addressed.

Your 'Exception Processes' setting gets close to what I need. I think what you need is a similar 'Exception Files' feature, where if files of a given file-spec (regex or wildcard defined) are open R/W the computer will not sleep to prevent data corruption.

I suggest you take a look at utilities like Handle (https://docs.microsoft.com/en-us/sysinternals/downloads/handle), etc. Source: (https://github.com/xcud/sysinternals-source/blob/master/download.sysinternals.com/Files/Handle.zip) or if that doesn't work out perhaps Stand-Bye could shell-out to this or a similar utility in the background and parse the results looking for matching files before deciding to go to sleep.

Another more general approach that could be useful for this issue as well as others might be an "execute app before sleep" (checks result code before proceeding to sleep) and an "execute app on wake". This would give me the hooks I need to at least implement some workarounds.

Or, if I get the time, I might be able to implement the feature myself. But it doesn't look like you're accepting outside contributions and reading your license it looks like I can't fork & distribute myself so it's probably not worth the effort. (??)

Thanks for building a great utility. I hope you continue to support and improve it!

@fubar-1
Copy link
Author

fubar-1 commented Mar 14, 2018

Uh, wrong link, no source code example available from SysInternals. This is in VB but does show how to drive the Win32 API. https://gallery.technet.microsoft.com/scriptcenter/Enumerate-OPen-Files-on-feb939f7

@flobaader
Copy link
Member

Hi Dave,

thank you for your feedback. We stopped working on the opensource c++ version of Stand-Bye!.
But soon we will release the first version of the "new" Stand-Bye! completely rewritten using C# and WPF.
That's why implementing these hooks for the old version is not worth the effort.

Generally, we don't re-invent the wheel - we are just triggering the windows standby. Therefore are corrupted files officially not the fault our the software - but that doesn't the solve the problem of course.

We are currently thinking about a plugin system for the new version. We don't know yet if anyone would be interested in developing custom hooks and blockers.

We will definitely have a look at the possibility of implementing your feature, but I can't promise.

If you want to, you could test the new prototype. Every beta tester will get a lifetime plus license for free (just leave your email).

Kind regards,

Florian Baader

@flobaader
Copy link
Member

But you can, of course, republish the software by yourself according to the GPL license. But it's forbidden to change the license.

@fubar-1
Copy link
Author

fubar-1 commented Mar 31, 2018

Hi Florian,

Apologies for the delay in my response. And didn't mean to blame Stand Bye in any way, I just wanted to make sure you're aware of the situation and offer some ideas.

In my opinion I think you will find that it is an absolute requirement that your commercial version, targeted at corporate environments block sleep when remote file handles are held open in a writable mode. Having worked at such places for a long time, even the possibility of data corruption is an issue that will immediately halt any sale. Probably blacklisting such resources and allowing whitelist exceptions is what I would recommend.

I'm experienced in C#/WPF and would be interested in developing hooks/blockers if that option were available, but I don't know if it's worth the effort - people who are capable & motivated are rare breed.

Since you're apparently at a relatively advanced stage in your new app, I agree it makes little sense to fork your code and take it forward.

But sure, if you're looking for beta testers I'd be happy to help. My e maail is dgeise aat yahoo.com. (a bit obfuscated to slow down address skimmers)

Thanks for responding! Feel free to close this bug if you like.
Dave

@flobaader flobaader self-assigned this Apr 1, 2018
@flobaader
Copy link
Member

flobaader commented Apr 1, 2018

Hi Dave,

you are absolutely right that a commercial version requires absolute safety for network files. We have already done a bit of research and took a look at your given example.
Thank you very much for your help and the good idea!

And thanks for your mail - we will get in touch with you as soon the new version is ready for beta.

Kind regards,

Florian

@fubar-1
Copy link
Author

fubar-1 commented Apr 2, 2018

Thanks Florian. Good luck.

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