Sublime Forum

Is it possible to get a remote file path via ST2 plugin API?

#1

When you open a file from an SFTP app like Transmit or Cyberduck ST2 displays the temporary file path. Is it possible via the plugin API to get the remote server file path?

Example:
Using Transmit open a file on a linux server at /etc/hosts

In ST2 it will show as ~/Library/Caches/Clean At Startup/Transmit/81790A16-CBF2-4CD3-A4E4-719AD5C7BD47/hosts

Is it possible through the plugin API to get that files real server path?

I want to know if its even possible because if so I’m going try to make a plugin to display the real server path instead of the local temp path.

Thank you,

0 Likes

#2

I really don’t know python but looking into to it this morning I don’t think its possible. In os.path there isn’t anything I can see that would have access to the remote server path, just the current temp folder path. I think this is possible but only from Apple’s Cocco Framework file handler.

Objective-C has something like this

externalPath = [appleEventDescriptor paramDescriptorForKeyword:keyFileCustomPath] stringValue];

What I think is happening is that code is telling the OS to pretend the file is at the “CustomPath” instead of its real path. The result is when you open a remote file you can in the text editor display the files remote path.

Since ST2 is written in C++ I suspect it will never support native remote file path display. That is probably going to be a deal breaker for me. I really want to use this app but this one feature is a requirement for me workflow.

0 Likes