Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#28 fuse options

open
xaizek
None
5
2012-09-11
2012-04-25
No

When using fuse with vifm, I do things like this

filetype *.ftp FUSE_MOUNT2|curlftpfs %PARAM %DESTINATION_DIR
and I have a file server.ftp containing the url of the server.

My problem is that I use servers wanting passive connection and others wanting active connections.
So now I must do
" passive ftp (default)
filetype .ftp FUSE_MOUNT2|curlftpfs %PARAM %DESTINATION_DIR
" active ftp
filetype
.active.ftp FUSE_MOUNT2|curlftpfs %PARAM %DESTINATION_DIR -o ftp_port=-,disable_eprt

As the second case (active mode is rare), I would prefer to specify the option in the ftp file with something like
filetype *.ftp FUSE_MOUNT2|curlftpfs %OPTIONS %PARAM %DESTINATION_DIR
and in ftp file
first line: url
second line: options
Do you think it could be possible without breaking other uses of vifm and fuse.

By the way, while thinking about this I wanted to look in the help. I didn't find anything about fuse (except fusehome option). Did I miss something?

Discussion

  • xaizek
    xaizek
    2012-04-25

    Good idea.

    Do you think it could be possible without breaking other uses of vifm and fuse.

    I think about more general case, when we could refer to the file content as an array of its lines. I already thought about position arguments for user defined commands, which can be useful sometimes. The syntax for these two cases could be the same. And to do not break anything both %a and %PARAM could refer to whole list (it would be incompatible change for %PARAM, since currently it means only the first line of file, but I doubt whether someone used the possibility to write whatever he wants to second and all other lines). It could be %PARAM[2]... and %a[1] (if this will be added). Such syntax shouldn't break shell commands, however I just thinking about it, not going to implement it right now.

    By the way, while thinking about this I wanted to look in the help. I didn't find anything about fuse (except fusehome option). Did I miss something?

    No, it seams like it's really absent in the documentation... There is something regarding FUSE in the FAQ file. I should take it, old strings from vifmrc and add a new section to the documentation about FUSE. Thanks for pointing that out.

     
    Last edit: xaizek 2013-10-05


  • 2012-04-28

    I've just tried this

    filetype *.something.ftp FUSE_MOUNT2|curlftpfs -o ftp_port=-,disable_eprt %PARAM %DESTINATION_DIR
    and i get error about missing host.
    If I put the option at the end, it works
    (FUSE_MOUNT2|curlftpfs %PARAM %DESTINATION_DIR -o ...)

    I checked with the shell, the command work with options at the end or the beginning. So I think it's due to vifm. Though it's not very annoying maybe it's something that could be interesting to fix.

     
  • xaizek
    xaizek
    2012-04-29

    You need to double comma sign to tell vifm not to treat is a program separator (it was your idea actually :-) ).
    Though it didn't worked without the latest updates, the :file menu displayed programs correctly, but internal methods that get default program associated with file type was broken.

     


  • 2012-04-30

    double comma
    Indeed, I completely forgot about this. Finally, it was a good idea ;-)
    I will change my vifmrc, because finally both command did not work (except that maybe the disable_eprt was not necessary).
    Thank for the answer.