Remove File Change Prompt (Help Make FileZilla A Lot Faster)

Moderator: Project members

Message
Author
azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Remove File Change Prompt (Help Make FileZilla A Lot Faster)

#1 Post by azoundria » 2011-05-09 18:48

So FileZilla is an amazingly fast and easy to use tool. I really appreciate all the work that went into making this tool so fast and easy to use.

Unfortunately, I do not agree with a decision which the creators have made, and it costs me many hours of my time. It is the primary reason I don't use FileZilla when I have a lot of editing to do.

It is - this dialog box:
Image

Not only is the question inherently obvious, but it pops up every single time I edit anything. Why it's only fractions of a second faster than uploading the file myself through drag and drop. 90% of the benefit of the feature is lost.

So far, the reasoning behind this decision, as best I can sum it up, is because of certain risks when it fails. Okay, these are real risks and do cause the loss of the entire file. I appreciate your concern for my welfare, however in the time I save from not having this dialog, I can rebuild my files from scratch several times over that I'd lose from any errors.

Considering that I also keep backups, and my text editor (which is still open) still has a local copy, this can now be considered several hundred times.

Due to these risks, the FileZilla creators have decided to entirely reject even having the option to disable this box. The good thing about FileZilla being open source is that anyone here can take the source, override that dialog so it doesn't happen, and distribute the new file. Based on the number of people who I've seen ask for this simple modification, and the lack of any opposition (aside from the creators themselves), I should say your download would be very popular.
Last edited by azoundria on 2011-05-09 20:30, edited 1 time in total.

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Simple Mod To Make FileZilla A Lot Faster

#2 Post by azoundria » 2011-05-09 20:01

Okay, I have found code modifications here:
pants wrote: Here's an easy tweak to edithandler.cpp:

inside checkmodifications_loopbegin at line 631, modify four lines starting at 679, by commenting out three of them and changing the if statement to always be true:

Code: Select all

//			int res = DisplayChangeNotification(CEditHandler::fileType(i), iter, remove);
//			if (res == -1)
//				continue;

			if (1)//(res == wxID_YES)

And to make it more responsive, responding to a changed file within a second or two instead of 15s:

Line 832:

Code: Select all

void CEditHandler::SetTimerState()
{
	bool editing = GetFileCount(none, edit) != 0;

	if (m_timer.IsRunning())
	{
		if (!editing)
			m_timer.Stop();
	}
	else if (editing)
		m_timer.Start(15000); //CHANGE 15000 to 1000
}
This is outdated and some of the line numbers may have changed.

The source is here, in a bizarre tar.bz2 format. (You can use 7Zip to unzip it.)

In the interests of allowing everyone access to use this feature, I just need someone trustable to compile installations for all the operating systems (Windows, Mac, and Linux) like you can find on the FileZilla download page. I am willing to host the files until a more permanent location could be found. If someone already knows how to do this, that would be awesome. If I have any breakthroughs on my own, I'll let you know.

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#3 Post by botg » 2011-05-09 21:01

That's one extremely dangerous change. It will result in FileZilla uploading (and thus locking a file) while it may still be written to by another program.

The result? Simple: Local file corrupt, remote file corrupt and you likely not having done backups.

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#4 Post by azoundria » 2011-05-09 22:27

Thanks for taking the time to respond personally to this as I guess this is frustrating for you to have such a backlash on this issue. I know the problem you're talking about because I ran into it with other FTP programs (FireFTP for example). I really appreciate all the effort you've put into ensuring this is a stable and quality program here. I understand that these kinds of problems can be confusing for many users, and that only results in you having to address support requests.

I don't fully understand how locking of files work, so maybe here's a few questions:
1) How is it possible that two programs (the editor and FileZilla) can both 'lock' a file? Isn't the purpose of a lock to limit a file so only one program can access it and does that not defeat the purpose of a lock if two programs can both use something?

2) When you say 'corrupted', what exactly does that mean? Does it mean the contents are empty? Is there no way to check if the contents are empty, and abort the operation? Does reading from the file to see if it's transferable also cause problems?

3) Have you considered saving a backup of the file when it's downloaded, then when you go to upload, and this situation happens you can simply restore the file from the backup.

4) What about renaming the file, uploading, then remote renaming? If you can rename the file, doesn't that mean it is not being written to? If the problem is two programs accessing the same file, then couldn't you make it a different file by a rename.

5) If FileZilla came with a really simple editor (with basic syntax highlighting) then that could provide for complete reliability (as has already been suggested). Probably there is already an open source text editor you can modify to work with FileZilla.

I will grant you that this is probably a very big complex challenge. I don't know about impossible however.

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#5 Post by botg » 2011-05-10 06:10

Some programs save their data in small chunks, opening and closing the file multiple times. They definitely don't like it if another program locks the file in between two chunks. Even if a program writes its data in a single chunk it won't help. As saving takes time, imagine what happens if a badly written FTP program picks up that the file has changed and starts uploading while the file is still not written completely. Some parts on the server are now from the old content, some from the new and thus the file is corrupt.

Corrupt I mean exactly like that, the contents are no longer valid.

Backups won't help as you cannot detect this situation programmatically.

Renaming won't help as either the file is locked for writing (Windows) or other still open file handles to the file aren't affected at all by it and thus the file is continued to be written to (Linux)

Won't integrate an editor into FileZilla itself. The right tool for the right task, and an editor does not belong into an FTP client. Speaking of syntax highlighting, my favourite programming language is C++. Doing syntax highlighting correctly requires a full C++ parser. Definitely don't won't to have that in FileZilla.

User avatar
boco
Contributor
Posts: 26913
Joined: 2006-05-01 03:28
Location: Germany

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#6 Post by boco » 2011-05-10 13:57

Stuck between a rock and a hard place, regarding this functionality. First, let me say the other FTP clients are taking chances. A software should never rely on chances in any way. The box is the logical consequence of the dilemma, though it interrupts workflow somewhat.

The only solution would be an editor that actively notifies FZ once saving is complete (aside from the 'integrated editor' idea). I don't know a way to do this on multiple platforms (maybe DDE on Windows).
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#7 Post by azoundria » 2011-05-11 15:59

So if it's impossible to know when you can upload the file, how does it help anything to confirm? Adding a dialog only means I had to click Okay AND lost my data, rather than just losing my data. Me being to blame for it doesn't restore the data. All I know is how long it's been since I last saved.


I think a really simple solution is to check for modifications a set number of times in 0.5 second increments. If it changed on the first check, but never changed since then (over the course of the remaining checks) then there's a extremely low probability it's still being written to. Check last modified date and file size.

That would imply a program started writing, then stalled for however long without modifying anything. For 3 checks, it took the program a full second between chunk writes. This is forever in terms of a program execution. For 5, a couple seconds. To be extremely safe, check it 7 times. Heck, you could set it to 15 if you wanted, and let the user lower it.


Under what reasonable circumstances would a program start writing a chunk to a file, stall for a full second, then write another chunk, and expect the file to always be intact? Whatever program that is, I wouldn't use it. Whatever strange conditions, I challenge you to replicate them just once with ANY program used by over 100 people.


Even in the conditions of lost files, the files read as empty (0 bytes). So how can it be impossible to detect something happened? If the file is 0 bytes, something happened that the user should be aware of, regardless if you have the Okay dialog or not.
Last edited by azoundria on 2011-05-12 01:44, edited 1 time in total.

User avatar
boco
Contributor
Posts: 26913
Joined: 2006-05-01 03:28
Location: Germany

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#8 Post by boco » 2011-05-11 21:13

Just a very simple decision from the developer: FileZilla cannot detect when a file has finished writing, so it leaves the decision to the user.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#9 Post by azoundria » 2011-05-12 01:44

But it doesn't really leave that decision to the user unless I can say 'Yes To All'. The decision is made for me that I must click Okay every time I make even the smallest change in a file.

User avatar
boco
Contributor
Posts: 26913
Joined: 2006-05-01 03:28
Location: Germany

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#10 Post by boco » 2011-05-12 13:44

botg already said there would be only one alternative - not trying to uploading the file back at all so the user would have to do manually.
No support requests over PM! You will NOT get any reply!!!
FTP connection problems? Please read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
FileZilla Pro support: https://customerforum.fileZilla-project.org

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#11 Post by botg » 2011-05-12 20:33

The thing is, normal users cannot make an informed choice, they do not understand the risks involved. At times even seasoned software developers fail to understand this issue.

As such, users would blindly check a dangerous "destroy my data" checkbox without understanding the risks.

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#12 Post by azoundria » 2011-05-16 16:48

As such, users would blindly check a dangerous "destroy my data" checkbox without understanding the risks.
That's why I'm asking for a mod/addon rather than another version of the software.


I'm also trying to understand the full concern of impossibility:

Under what reasonable circumstances would a program start writing a chunk to a file, stall for a full second, then write another chunk, and expect the file to always be intact?

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#13 Post by botg » 2011-05-16 17:19

Programs that assume nobody else is touching those files.

azoundria
500 Syntax error
Posts: 16
Joined: 2011-05-09 18:16
First name: Matt
Last name: McGirr

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#14 Post by azoundria » 2011-05-17 19:24

With all due respect as this is your project, I'm still trying to understand what program would validly assume no one else will touch a file for a full second.

User avatar
botg
Site Admin
Posts: 35509
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

Re: Remove File Change Prompt (Help Make FileZilla A Lot Fas

#15 Post by botg » 2011-05-17 21:15

Programs with a file based database backend come to mind. For some of these programs, all changes done are immediately written to the file. File handles may or may not being kept open, but that doesn't matter for two reasons:
a) Cannot reliably detect whether another program has an open handle to the file. That's contrary to modern operating design, in particular process isolation, especially between different users. With network resources it won't work either in most cases.
b) Local file storage based databases such as SQLite intentionally don't keep exclusive file handles such that other instances of the database can access the file concurrently.

An example for such a program would be Firefox. Add a bookmark? Being written to file instantly. Click a URL? History being written to file instantly. Granted, one usually doesn't edit remote Firefox settings files, but it should illustrate the problem. If blindly copying a database file at the wrong time without regard to the specific locking and journaling protocols of that specific database, the copy will be corrupt without one noticing it.

Post Reply