unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Remove the magic portion of a remote file name
@ 2014-04-16 13:38 Bozhidar Batsov
  2014-04-16 14:11 ` Michael Albinus
  0 siblings, 1 reply; 3+ messages in thread
From: Bozhidar Batsov @ 2014-04-16 13:38 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Hi guys,  

I wonder what's the authoritative way to obtain the local file name portion
of a remote file name? I’m looking for a function that would turn
"/ssh:root@192.168.1.1:/some/path/file" into "/some/path/file". I
know of `tramp-dissect-file-name', but I wonder if there's a better way, that doesn’t involve requiring tramp.


Perhaps there’s no such function and we can add one.  

--  
Cheers,
Bozhidar


[-- Attachment #2: Type: text/html, Size: 774 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remove the magic portion of a remote file name
  2014-04-16 13:38 Remove the magic portion of a remote file name Bozhidar Batsov
@ 2014-04-16 14:11 ` Michael Albinus
  2014-04-16 14:52   ` Bozhidar Batsov
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Albinus @ 2014-04-16 14:11 UTC (permalink / raw)
  To: Bozhidar Batsov; +Cc: emacs-devel

Bozhidar Batsov <bozhidar@batsov.com> writes:

> Hi guys, 

Hi Bozhidar,

> I wonder what's the authoritative way to obtain the local file name
> portion
> of a remote file name? I’m looking for a function that would turn
> "/ssh:root@192.168.1.1:/some/path/file" into "/some/path/file".

(file-remote-p "/ssh:root@192.168.1.1:/some/path/file" 'localname)

> I know of `tramp-dissect-file-name', but I wonder if there's a better
> way, that doesn’t involve requiring tramp.

Internally, it could use Tramp, but you don't need to require it.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Remove the magic portion of a remote file name
  2014-04-16 14:11 ` Michael Albinus
@ 2014-04-16 14:52   ` Bozhidar Batsov
  0 siblings, 0 replies; 3+ messages in thread
From: Bozhidar Batsov @ 2014-04-16 14:52 UTC (permalink / raw)
  To: Michael Albinus; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

Thanks, Michael! I guess I didn't expect that a function with a predicate
name would do something like that. :-)


On 16 April 2014 17:11, Michael Albinus <michael.albinus@gmx.de> wrote:

> Bozhidar Batsov <bozhidar@batsov.com> writes:
>
> > Hi guys,
>
> Hi Bozhidar,
>
> > I wonder what's the authoritative way to obtain the local file name
> > portion
> > of a remote file name? I’m looking for a function that would turn
> > "/ssh:root@192.168.1.1:/some/path/file" into "/some/path/file".
>
> (file-remote-p "/ssh:root@192.168.1.1:/some/path/file" 'localname)
>
> > I know of `tramp-dissect-file-name', but I wonder if there's a better
> > way, that doesn’t involve requiring tramp.
>
> Internally, it could use Tramp, but you don't need to require it.
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 1315 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-16 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 13:38 Remove the magic portion of a remote file name Bozhidar Batsov
2014-04-16 14:11 ` Michael Albinus
2014-04-16 14:52   ` Bozhidar Batsov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).