Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to update lastaccesstime of a remote file ?  RSS feed

 
pradeep g mishra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I wanted to know how can I programatically update the "Last Access Time" of a file which is sitting in a remote system shared through windows file share (DFS).

I have access to SmbFile but not sure how can I access java.io.File object for a remote file.

Any help will be highly appreciated?
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can access files on a remote share using java.io.File, as long as a) the file's path starts with \\ or // (I usually use //, otherwise I have to escape \\ to \\\\), and b) the user that is running the Java program has access to the remote share.

But you say you have an SmbFile. Have you tried its own setLastModified method?
 
Tony Docherty
Bartender
Posts: 3268
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!