unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Jean Louis <bugs@gnu.support>
To: help-gnu-emacs@gnu.org
Subject: Re: Function to find symlink target
Date: Wed, 1 Jun 2022 10:43:39 +0300	[thread overview]
Message-ID: <YpcYq/+zOKwugW7H@protected.localdomain> (raw)
In-Reply-To: <87k0a199t2.fsf@dataswamp.org>

* Emanuel Berg <incal@dataswamp.org> [2022-05-31 15:32]:
> > Symlinks greatly help in that case, and do spare the hard
> > disk space.
> 
> Compared to duplicating all the files physically on the
> local machine?

Yes, symlinks can be in a different file structure than their actual
files on the hard disk.

For example:

~/hyperscope/1/2/3/my-file.pdf may be in a complex structure of other
documents, maybe in the same directory could be other 200 files, and
file could be related to ABC subject.

Same file in the public_html directory:

~/public_html/www.example.com/files/world/my-file.pdf 

then may give quite different context, different meaning in a different
file structure. And even file name in WWW structure should may become
more meaningful then the actual file name, that is matter of marketing
online. 

Then I use often this command to give me the actual WWW link to the
file provided file is in my public_html directory:

(defun loc ()
  "Locates the files, and if it is in public_html, it constructs the URL"
  (interactive)
  (let* ((files (dired-get-marked-files)))
    (kill-new (with-temp-buffer
		(while files
		  (let* ((file (pop files))
			 (uri (if current-prefix-arg file
				(public-html-rest file))))
		    (insert uri "\n")))
		(buffer-string)))))

If the file is then located in WWW structure, I would do `M-x loc' on
the file and get a result like:

https://www.example.com.com/files/world/2020/04/foundation.pdf

but if file is not located in WWW structure, I would get result like:

~/public_html/www.example.com/files/world/my-file.pdf 

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  reply	other threads:[~2022-06-01  7:43 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 20:55 Function to find symlink target Jean Louis
2022-05-18 23:00 ` Emanuel Berg
2022-05-22 13:52   ` Jean Louis
2022-05-22 18:02     ` Emanuel Berg
2022-05-23  9:05       ` Jean Louis
2022-05-23 20:46         ` Emanuel Berg
2022-05-24  0:59           ` Emanuel Berg
2022-05-24  1:09             ` Michael Heerdegen
2022-05-24  2:14               ` Emanuel Berg
2022-05-24  2:27                 ` Michael Heerdegen
2022-05-24  8:04                   ` Emanuel Berg
2022-05-24  8:52                     ` Michael Heerdegen
2022-05-25  5:54                       ` Michael Heerdegen
2022-05-27  2:25                         ` Jean Louis
2022-05-27  3:31                           ` Michael Heerdegen
2022-05-27  8:00                             ` Jean Louis
2022-05-27 14:47                           ` Emanuel Berg
2022-05-28  6:43                             ` Jean Louis
2022-05-28 15:29                               ` Emanuel Berg
2022-05-28 15:43                                 ` Emanuel Berg
2022-05-28 16:08                                   ` Eli Zaretskii
2022-05-28 16:46                                     ` Emanuel Berg
2022-05-28 16:55                                       ` Eli Zaretskii
2022-05-28 17:05                                         ` Emanuel Berg
2022-05-31  6:27                                 ` Jean Louis
2022-05-31 12:24                                   ` Emanuel Berg
2022-05-31  6:31                                 ` Jean Louis
2022-05-31 12:16                                   ` Emanuel Berg
2022-06-01  7:43                                     ` Jean Louis [this message]
2022-06-02  0:40                                       ` Emanuel Berg
2022-06-02  5:15                                         ` Jean Louis
2022-06-05  5:40                                           ` Emanuel Berg
2022-05-25  5:05                 ` Jean Louis
2022-05-25 22:33                   ` Emanuel Berg
2022-05-29  2:01                     ` Emanuel Berg
2022-05-19 23:14 ` Nick Dokos
2022-05-20  0:42   ` Emanuel Berg
2022-05-23  8:17   ` Jean Louis
2022-05-23 22:49     ` Michael Heerdegen
2022-05-23 22:57       ` Emanuel Berg
2022-05-24  0:59         ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YpcYq/+zOKwugW7H@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).