Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

BOOTCAMP Change Last Opened Date.

When i get info my bootcamp partition, I get Last Opened: January 1 1970.... which is not true. How can I set the date with some commands. I have tried accessing the files and modifying it but the date remains same. 'touch' command and 'setfile' command do nothing to change it. Please help!

User uploaded file

MacBook Pro, OS X El Capitan (10.11)

Posted on Feb 24, 2016 1:51 AM

Reply
Question marked as Best reply

Posted on Feb 24, 2016 10:14 AM

Is it causing a problem? The "last opened date" is not a file system attribute, but metadata. Finder would have to write that metadata, or you can do it with xattr. I doubt that booting Windows would set that metadata attribute.

12 replies

Feb 24, 2016 10:39 AM in response to stormxeron

stormxeron wrote:


No, booting won't change a thing.

I tried using xattr using command:


xattr -d com.apple.quarantine /Volumes/BOOTCAMP

But this wont change a thing.

What command should I use?

Not sure why setting the Quarantine attribute seemed relevant. You would need to change the last opened date attribute (kMDItemLastUsedDate), but I'm not sure what purpose that would serve.

Feb 25, 2016 11:46 AM in response to stormxeron

RE:@Barney-15E

AND also:

kMDItemLastUsedDate has following info:

User uploaded file

The information stored in kMDItemLastUsedDate is obviously not true because even though the date is same, the time is not the same (i.e 5:30 am) in every other metadata attributes as i posted earlier. So my conclusion is that the information about last opened date is stored somewhere but I cannot find it.

Mar 7, 2016 9:26 AM in response to stormxeron

The -d deletes the attributes. It doesn't change them. You would need to use the write syntax to change the value.

I don't know what the OS does if it finds those missing. It could recreate them. Run mdls and see if they were deleted after running the delete commands.


If Get Info and the metadata do not match, then I would assume those entries are not related, or Finder is just ignoring them or can't read them (null might be displayed as 0),

Feb 25, 2016 6:00 PM in response to Barney-15E

Well I found this:
The value of attributes changed by command xattr is independent of the values displayed by the mdls

When I did this in a text file:

mdls -name kMDItemLastUsedDate /Users/StormXeron/Desktop/commands\ copy.txt


the stored date in kMDItemLastUsedDate was displayed as:

User uploaded file

Then I use xattr write function as suggested by you as

xattr -w com.apple.metadata:kMDItemLastUsedDate "2016-01-01 12:34:56 +0000" /Users/StormXeron/Desktop/commands\ copy.txt


xattr -w kMDItemLastUsedDate "2016-01-01 12:34:56 +0000" /Users/StormXeron/Desktop/commands\ copy.txt


Now here I found a difference:

I. With mdls results:(Unchanged output)
Input:

mdls -name kMDItemLastUsedDate /Users/StormXeron/Desktop/commands\ copy.txt

Output:

User uploaded file

2. With xattr -l the results were

Input:

xattr -l /Users/StormXeron/Desktop/commands\ copy.txt

Output:

User uploaded file

Conclusion:

1.The attributes displayed by 'mdls' command is unchangable because the source of the values taken by those attributes are different so I cannot find it.

2. Interestingly, the xattr -w creates new attribute and then sets its value.

3. I can't find the command to change the attributes displayed by mdls. (this is what I need)😕

BOOTCAMP Change Last Opened Date.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.