Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
File setLastModified and iDisk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

File setLastModified and iDisk



I've noticed that File.setLastModifed(t) works as expected on local files but not on files located on an iDisk volume.

Is this a known issue?

Does anyone have a work around for this?


thanks Bill


A test case which always leaves the last modified time as the time of creation rather than the time set.



try { File f = new File("/Volumes/YOURIDISK/Documents/foo.txt"); // File f = new File("/Users/YOURID/Documents/foo.txt");

  if (!f.createNewFile()) {
    System.out.println("not created " + f.getAbsolutePath());
  }
  if (!f.setLastModified(50000)) {
    System.out.println("not modified " + f.getAbsolutePath());
  }
  if (f.lastModified() != 50000) {
    System.out.println(f.getAbsolutePath() + " " +
      new Date(f.lastModified()).toString());
  }
} catch (IOException e) {
  e.printStackTrace();
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.