unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* fractional file timestamps in tramp-adb
@ 2019-02-14 18:43 Paul Eggert
  2019-02-14 20:23 ` Michael Albinus
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Eggert @ 2019-02-14 18:43 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs development discussions

[-- 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


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

end of thread, other threads:[~2019-02-16  8:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-14 18:43 fractional file timestamps in tramp-adb Paul Eggert
2019-02-14 20:23 ` 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

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).