hadoop-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harsh J <ha...@cloudera.com>
Subject Re: How to get the file creation date/time of a hdfs file using java hdfs API
Date Sun, 04 Nov 2012 23:08:16 GMT
Rashmi,

Use FileSystem#getFileStatus(Path) [0] and then get the epoch mtime
via FileStatus#getModificationTime() [1]

[0] - http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileSystem.html#getFileStatus(org.apache.hadoop.fs.Path)

[1] - http://hadoop.apache.org/docs/current/api/org/apache/hadoop/fs/FileStatus.html#getModificationTime()

On Mon, Nov 5, 2012 at 4:19 AM, Nataraj Rashmi - rnatar
<Rashmi.Nataraj@acxiom.com> wrote:
> Hello,
>
>
>
> What is the best way to get the date a file was created on hdfs using java
> hdfs API?
>
>
>
> Thanks
>
> Rashmi
>
> ***************************************************************************
> The information contained in this communication is confidential, is
> intended only for the use of the recipient named above, and may be legally
> privileged.
>
> If the reader of this message is not the intended recipient, you are
> hereby notified that any dissemination, distribution or copying of this
> communication is strictly prohibited.
>
> If you have received this communication in error, please resend this
> communication to the sender and delete the original message or any copy
> of it from your computer system.
>
> Thank You.
> ****************************************************************************



-- 
Harsh J

Mime
View raw message