Posts

Showing posts from April, 2015

FTP-backed filesystem with aggressive caching

I know, I know. It's 2015 and nobody uses FTP anymore. But by some unlucky coincidence, I found myself forced to use it - because the target machine couldn't have ssh for political reasons. After some googling around I found CurlFtpFS - which mounts remote directory as a FUSE filesystem. It works, but I find it to be horribly slow - it takes several seconds to save a file, and opening small text file in Emacs takes over a minute (as it turns out, in my configuration Emacs searches the neighborhood of the opened file all possible version control system files and autosave files from other editors - and with FTP, each stat() call gives 1 second delay). Since I didn't see any other way, I sat down to write my own FTP-backed filesystem with aggressive caching. The idea is that we don't expect that files on remote target will change often, so we can skip doing FTP calls for directory listings, file stats and the like if we have already cached them. I didn't implement