Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
dcap: use CHANGE_TIME to provide ctime on stat
Acked-by: Paul Millar
Target: master
Require-book: no
Require-notes: no
  • Loading branch information
kofemann committed Nov 19, 2013
1 parent 7501da4 commit 752e058
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Expand Up @@ -1310,7 +1310,7 @@ public void fileAttributesAvailable()
sb.append("-st_gid=").append(meta.getGid()).append(" ");
sb.append("-st_atime=").append(meta.getLastAccessedTime()/1000).append(" ");
sb.append("-st_mtime=").append(meta.getLastModifiedTime()/1000).append(" ");
sb.append("-st_ctime=").append(meta.getCreationTime()/1000).append(" ");
sb.append("-st_ctime=").append(meta.getLastChangedTime()/1000).append(" ");

FileMetaData.Permissions user = meta.getUserPermissions() ;
FileMetaData.Permissions group = meta.getGroupPermissions();
Expand Down
Expand Up @@ -32,6 +32,9 @@ public class FileMetaData implements Serializable {

private long _created;

private long _lastChange;
private boolean _isChangeTimeSet;

private long _lastAccessed;
private boolean _isATimeSet;

Expand Down Expand Up @@ -190,6 +193,10 @@ public FileMetaData(FileAttributes attributes)
setLastAccessedTime(attributes.getAccessTime());
break;

case CHANGE_TIME:
setLastChangedTime(attributes.getChangeTime());
break;

case MODIFICATION_TIME:
setLastModifiedTime(attributes.getModificationTime());
break;
Expand Down Expand Up @@ -258,6 +265,9 @@ public long getLastAccessedTime() {
return _lastAccessed;
}

public long getLastChangedTime() {
return _lastChange;
}
/**
*
* @param accessed
Expand Down Expand Up @@ -305,6 +315,11 @@ public boolean isMTimeSet() {
return _isMTimeSet;
}

public void setLastChangedTime(long newTime) {
_lastChange = newTime;
_isChangeTimeSet = true;
}

public boolean isDirectory() {
return _isDirectory;
}
Expand Down Expand Up @@ -536,6 +551,6 @@ public FileAttributes toFileAttributes()
public static Set<FileAttribute> getKnownFileAttributes()
{
return EnumSet.of(OWNER, OWNER_GROUP, MODE, TYPE, SIZE,
CREATION_TIME, ACCESS_TIME, MODIFICATION_TIME);
CREATION_TIME, ACCESS_TIME, MODIFICATION_TIME, CHANGE_TIME);
}
}

0 comments on commit 752e058

Please sign in to comment.