Sublime Forum

[Fixed in 2133] Workaround - gvfs ftp woes

#1

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.

#!/bin/bash while true do ls ~/.gvfs/* &> /dev/null sleep 30 done

Next up is to make it executable:

$ 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.

$ 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.

0 Likes

#2

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.

0 Likes

#3

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

0 Likes

#4

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 :frowning:

0 Likes

FTP files empty
#5

Bump.

Any work arounds for this issue?

Not being able to browse via gvfs is a deal breaker.

0 Likes

#6

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:

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

0 Likes

Sublime Text and gvfs doesn't play nicely together