From: Paul Eggert <eggert@cs.ucla.edu>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: Emacs development discussions <emacs-devel@gnu.org>
Subject: fractional file timestamps in tramp-adb
Date: Thu, 14 Feb 2019 10:43:30 -0800 [thread overview]
Message-ID: <281200e8-bc54-e390-94f8-895345af524c@cs.ucla.edu> (raw)
[-- Attachment #1: Type: text/plain, Size: 629 bytes --]
The attached recently-installed patchchanges the tramp-adb's generated
shell command from this format:
touch -t 201902141023.17 file
to this format:
touch -d 2019-02-14T18:23:17 file
A downside of the new approach is that it assumes POSIX.1-2008 or later,
but I guess that's OK nowadays. An upside is that 'touch -d' lets one
specify the fractional part of the timestamp, and also lets one specify
that the timestamp is UTC by appending "Z" (I don't see how the current
code is arranging for UTC). So, how about the attached followup patch?
It would change the format to:
touch -d 2019-02-14T18:23:17.318491822Z file
[-- Attachment #2: 0001-Add-fractional-file-timestamps-to-tramp-adb.patch --]
[-- Type: text/x-patch, Size: 905 bytes --]
From 68d572c9b6869556f02ca1118025b94d27723aa4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Thu, 14 Feb 2019 10:40:37 -0800
Subject: [PATCH] Add fractional file timestamps to tramp-adb
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
Set fractional part of file timestamp too. Specify UTC.
---
lisp/net/tramp-adb.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 22f2c5f6bf..5dbcf55067 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -680,7 +680,7 @@ tramp-adb-handle-set-file-times
time)))
(tramp-adb-send-command-and-check
v (format "touch -d %s %s"
- (format-time-string "%Y-%m-%dT%H:%M:%S" time t)
+ (format-time-string "%Y-%m-%dT%H:%M:%S.%NZ" time t)
(tramp-shell-quote-argument localname))))))
(defun tramp-adb-handle-copy-file
--
2.20.1
next reply other threads:[~2019-02-14 18:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 18:43 Paul Eggert [this message]
2019-02-14 20:23 ` fractional file timestamps in tramp-adb Michael Albinus
2019-02-14 23:41 ` Paul Eggert
2019-02-15 8:11 ` Michael Albinus
2019-02-15 22:37 ` Paul Eggert
2019-02-16 8:33 ` Michael Albinus
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=281200e8-bc54-e390-94f8-895345af524c@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/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.
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).