Home Download Buy Blog Forum Support

[Fixed in 2133] Workaround - gvfs ftp woes.

[Fixed in 2133] Workaround - gvfs ftp woes.

Postby dallbee on Sun Oct 16, 2011 2:42 am

Sublime Text 2 is a wonderful editor, and for a while I've been wanting to use it as my primary tool for programming. There numerous issues with sublime text and a mounted FTP drive under gnome were stopping me however, and I'm happy to say I have a few workarounds:

4KB Filesize Limitation
Problem: Some files over 4kb will load as blank files, and can be overwritten if you accidentally save.
Workaround: Change the protocol. SSH and WebDav gvfs mounts both seem to work just fine. FTP seems to be the only protocol with the issue.

Slow refresh, and the inability to save files.
Problem: After a set period of time, the ftp mount will disconnect and sublime can toss various issues about reloading files and being unable to save. This isn't really sublime's fault, but rather due to the lack of a keep alive option with gvfs.
Workaround: A simple bash script can keep all FTP sessions alive. Here's a quick guide on how to do just that.

Save the following file as gvfs-keep-alive. You can replace sleep 30 with sleep 15 if your sessions still close. I found 30 to be sufficient for most hosts.
Code: Select all
#!/bin/bash
while true
do
   ls ~/.gvfs/* &> /dev/null
   sleep 30
done


Next up is to make it executable:
Code: Select all
$ sudo install ./gvfs-keep-alive /usr/bin
$ sudo chmod +x /usr/bin/gvfs-keep-alive


And finally, add to the end of your startup queve.
Code: Select all
$ sudo nano /etc/rc.d/rc.local

Add gvfs-keep-alive to the last line in that file, save and exit. You're done!

I hope this helps someone, and if you don't have SSH privileges with your server then I apologize - you're out of luck for now. As a final note, these same ideas should all work for Mac (I noticed that mac ftp file mounting has the exact same issue). I haven't tested it myself but it would be worth the try.
Last edited by dallbee on Sat Oct 22, 2011 7:04 pm, edited 2 times in total.
dallbee
 
Posts: 5
Joined: Sun Oct 16, 2011 1:54 am

Re: Workaround - gvfs ftp woes.

Postby jps on Tue Oct 18, 2011 2:42 pm

dallbee wrote:Problem: Some files over 4kb will load as blank files, and can be overwritten if you accidentally save.

I'd be interested in knowing if problem still happens for you in 2133.

In previous versions, a file open used these libc functions:

fopen()
fseek()
ftell()
fseek()
fread() (several times as required)

As of 2133, the fseek and ftell calls have been removed: this may help with belligerent filesystem implementations.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Workaround - gvfs ftp woes.

Postby dallbee on Sat Oct 22, 2011 6:58 pm

I just finished testing with the 2133 dev build as you asked. Kudos! It looks like the problem is indeed fixed. Now I can open threads about other problems xD
dallbee
 
Posts: 5
Joined: Sun Oct 16, 2011 1:54 am

Re: [Fixed in 2133] Workaround - gvfs ftp woes.

Postby heum on Fri Dec 02, 2011 7:19 pm

After 2133 build this problem was fixed, but it's happening again in 2144. Now, i have a problem with opening any file from gvfs FTP, 4 kb or 50 bytes - it doesn't matters. :cry: So bluefish 2.2 needed again :(
heum
 
Posts: 1
Joined: Fri Dec 02, 2011 7:13 pm

Re: [Fixed in 2133] Workaround - gvfs ftp woes.

Postby tylerjwilk on Sun Sep 08, 2013 10:21 pm

Bump.

Any work arounds for this issue?

Not being able to browse via gvfs is a deal breaker.
tylerjwilk
 
Posts: 4
Joined: Sun Sep 08, 2013 10:12 pm

Re: [Fixed in 2133] Workaround - gvfs ftp woes.

Postby mintystark on Tue Dec 10, 2013 7:36 am

I am having the same issue.
I trully love Sublime Text, but if it is not capable of working with remote servers then I can't use it.

This happens to me on Ubuntu using gvfs and using Transmit on Mac OS X
It is a real shame.

I did find that the script did help with gvfs connections, but with ST3 and ST2 I would still randomly get a blank file after saving the file. Which no matter what I did the file would stay blank I would have to restart the computer with Ubuntu as ST would be stalling and Force Kill would not do anything. Mac I would be able to close it and reopen it, but that is not acceptable for a production enviornment.

On Linux I have been using Geany. Geany had the same issues for gvfs, but with the script posted above, Geany is working smoothly. ST is not.

FYI on newer linux gvfs is stored in /run/user.
Here is my path in the script:
Code: Select all
ls /run/user/myusername/gvfs/ftp* &> /dev/null


Here are the issues I am getting:
- Saving a file randomly converts the file to a blank file.
- Saving a file would randomly hang and stall ST permenantly.
- Folder view would rondomly not show files or show a folder as blank. Refreshing Folders does nothing.

This is happening on both ST2 and ST3 on both Linux and Mac.

It seems that the main issue is not with ST, but with Mounting Remote Servers. However, ST should be smart enought to work with this as most other editors do.
Once this is resolved, I would love to purchase a license.

Thanks
mintystark
 
Posts: 2
Joined: Tue Dec 10, 2013 7:23 am


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Juje007 and 30 guests