You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "John Zhuge (JIRA)" <ji...@apache.org> on 2016/03/04 01:51:40 UTC

[jira] [Commented] (HADOOP-12832) Implement unix-like 'FsShell -touch'

    [ https://issues.apache.org/jira/browse/HADOOP-12832?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15179049#comment-15179049 ] 

John Zhuge commented on HADOOP-12832:
-------------------------------------

A new FsShell {{touch}} command with these features to replace {{touchz}}?
{code}
hdfs dfs -touch [-m] [-a] [-t <timestamp>] <file>

Changes both modification and access time of a file if it exists; otherwise, creates a new 0-length file. 

  -m    change only the modification time
  -a    change only the access time
  -t    use [CC]YY]MMDDhhmm[.ss] instead of current time

When both -m and -a flag are specified or neither is specified, change both modification and access time.
{code}

This looks more familiar to Unix/Linux users than a new FsShell {{setTimes}} or {{utime/utimes}} command. {{utime/utimes}} is a Linux syscall to change file last access and modification times.

> Implement unix-like 'FsShell -touch' 
> -------------------------------------
>
>                 Key: HADOOP-12832
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12832
>             Project: Hadoop Common
>          Issue Type: New Feature
>          Components: fs
>    Affects Versions: 2.6.4
>            Reporter: Gera Shegalov
>            Assignee: John Zhuge
>
> We needed to touch a bunch of files as in https://en.wikipedia.org/wiki/Touch_(Unix) . 
> Because FsShell does not expose FileSystem#setTimes  , we had to do it programmatically in Scalding REPL. Seems like it should not be this complicated.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)