Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > OS X

Reply
 
Thread Tools Search this Thread Display Modes
Old Oct 27, 2010, 05:55 PM   #1
Khryz
macrumors 6502a
 
Join Date: Jan 2007
Modifying the "Date Modified" date?? Possible?

Can someone tell me if there's a way to manually modify the "Date Modified" date on a file?

I have these overlay "Drawers" for my folders that make it look like the contents of my Movies, Docs, Downloads, etc are in a drawer but the drawers will only be in front if the Date Modified is obviously the newest.

I DL'ed these when Leopard first came out and they were "hacked" I guess to say October 26th, 2010. Well, yesterday is over so now my Drawers are in the middle of the folders.

Can someone help?
Khryz is offline   0 Reply With Quote
Old Oct 27, 2010, 06:13 PM   #2
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
From the Terminal use the 'touch' command.
RaceTripper is offline   0 Reply With Quote
Old Oct 27, 2010, 06:18 PM   #3
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
Can someone tell me if there's a way to manually modify the "Date Modified" date on a file?

I have these overlay "Drawers" for my folders that make it look like the contents of my Movies, Docs, Downloads, etc are in a drawer but the drawers will only be in front if the Date Modified is obviously the newest.

I DL'ed these when Leopard first came out and they were "hacked" I guess to say October 26th, 2010. Well, yesterday is over so now my Drawers are in the middle of the folders.

Can someone help?
This can be done from Terminal using the SetFile command, but I don't know if this command is available if you haven't installed the Xcode Developer Tools. You could give this a try, in any case:

Open Terminal (in Utilities) and enter the following but don't press return. Leave a space after the closing quotation mark:

Code:
SetFile -m "1/1/2020 10:10"
Then drag the file you want to modify and drop it in the Terminal window. This will append the file's path to the SetFile command. Click on the Terminal window to make it active, and then press return.

[EDIT]

As suggested by RaceTripper, you don't need the SetFile command for this type of file modification. So instead of the above, you can do this:

Open Terminal (in Utilities) and enter the following but don't press return. Leave a space after the final 0:

Code:
 touch -m -t 202012311010
Then drag the file you want to modify and drop it in the Terminal window. This will append the file's path to the touch command. Click on the Terminal window to make it active, and then press return.

Last edited by LPZ; Oct 27, 2010 at 06:37 PM. Reason: Suggestion from RaceTripper
LPZ is offline   0 Reply With Quote
Old Oct 27, 2010, 06:20 PM   #4
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by RaceTripper View Post
From the Terminal use the 'touch' command.
This will set the modification date to the current date. I think the OP wants to set the modification date to a "distant" future date, so he doesn't need to keep "touching" the file.
LPZ is offline   0 Reply With Quote
Old Oct 27, 2010, 06:22 PM   #5
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by LPZ View Post
This will set the modification date to the current date. I think the OP wants to set the modification date to a "distant" future date, so he doesn't need to keep "touching" the file.
You can specify the access and/or modification date of a file with touch. From the Terminal, type 'man touch' to see the options.

Unix was useful long before the Mac came to town.
RaceTripper is offline   0 Reply With Quote
Old Oct 27, 2010, 06:27 PM   #6
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by RaceTripper View Post
You can specify the access and/or modification date of a file with touch. From the Terminal, type 'man touch' to see the options.

Unix was useful long before the Mac came to town.
Thanks, you're right.
LPZ is offline   0 Reply With Quote
Old Oct 27, 2010, 06:49 PM   #7
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by LPZ View Post
Thanks, you're right.
I learned something too. I didn't know about SetFile.
RaceTripper is offline   0 Reply With Quote
Old Oct 27, 2010, 08:11 PM   #8
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Just curious before I attempt this but what's with the warning of not pressing Enter. Will that severely damage my computer or something?
Khryz is offline   0 Reply With Quote
Old Oct 27, 2010, 08:48 PM   #9
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by Khryz View Post
Just curious before I attempt this but what's with the warning of not pressing Enter. Will that severely damage my computer or something?
You gonna need to provide us a little more context.
RaceTripper is offline   0 Reply With Quote
Old Oct 27, 2010, 09:01 PM   #10
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
Just curious before I attempt this but what's with the warning of not pressing Enter. Will that severely damage my computer or something?
If you're referring to "but don't press return" then no, pressing return will not do any damage. If you press return before dragging the file into the Terminal window, then you'll enter an incomplete command and the system won't know what file you are trying to modify. You'll get a harmless warning message that tells you what you should have done. The warning looks like this:

Code:
usage: touch [-acfm] [-r file] [-t [[CC]YY]MMDDhhmm[.SS]] file ...
LPZ is offline   0 Reply With Quote
Old Oct 27, 2010, 09:40 PM   #11
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Oh ok thanks you two.

I will try this and let you know if I need anymore help.
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 12:43 PM   #12
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
So, this isn't working. I am getting "No such file or directory" when I do this.

What am I doing wrong?
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 01:14 PM   #13
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by Khryz View Post
So, this isn't working. I am getting "No such file or directory" when I do this.

What am I doing wrong?
Hard to say if you don't show what it is you are doing (like the exact command you are invoking).
RaceTripper is offline   0 Reply With Quote
Old Oct 31, 2010, 01:45 PM   #14
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Quote:
Originally Posted by RaceTripper View Post
Hard to say if you don't show what it is you are doing (like the exact command you are invoking).
Quote:
touch -t 209901311234 "FILENAME"
with the FILENAME being the file I drag into the Terminal window. Basically the same command line as what's earlier in this thread.

Then I just go into my Applications folder where I have my Applications Drawer Icon .. select it then drag into Terminal. Click the Terminal window .. then hit enter.
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 01:53 PM   #15
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by Khryz View Post
with the FILENAME being the file I drag into the Terminal window. Basically the same command line as what's earlier in this thread.

Then I just go into my Applications folder where I have my Applications Drawer Icon .. select it then drag into Terminal. Click the Terminal window .. then hit enter.
Works for me:
me@myhost: desktop $ touch -t 209901311234 /Users/me/Desktop/test.txt
me@myhost: desktop $ ls -l test.txt
-rw-r--r-- 1 me staff 0 Dec 26 1962 test.txt

Do you have spaces in your path? If so you'll need to enclose the path in quotes, or you need to escape the space characters with \ before each space.
RaceTripper is offline   0 Reply With Quote
Old Oct 31, 2010, 02:04 PM   #16
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Quote:
Originally Posted by RaceTripper View Post
Works for me:
me@myhost: desktop $ touch -t 209901311234 /Users/me/Desktop/test.txt
me@myhost: desktop $ ls -l test.txt
-rw-r--r-- 1 me staff 0 Dec 26 1962 test.txt

Do you have spaces in your path? If so you'll need to enclose the path in quotes, or you need to escape the space characters with \ before each space.
The only spaces I have are what I see from the quote .. touch[space]-t[space]the#'s[space]theFile .. not right?
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 02:05 PM   #17
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by RaceTripper View Post
Do you have spaces in your path? If so you'll need to enclose the path in quotes, or you need to escape the space characters with \ before each space.
Actually, any spaces in the path should be automatically escaped when the file is dropped into the Terminal window. At least, that's what happens for me.
LPZ is offline   0 Reply With Quote
Old Oct 31, 2010, 02:07 PM   #18
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
The only spaces I have are what I see from the quote .. touch[space]-t[space]the#'s[space]theFile .. not right?
Please copy the line you get in Terminal after dropping your file into the window but before pressing return. Post here.
LPZ is offline   0 Reply With Quote
Old Oct 31, 2010, 02:11 PM   #19
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Quote:
Originally Posted by LPZ View Post
Please copy the line you get in Terminal after dropping your file into the window but before pressing return. Post here.
After I put in the command then drag the file in I get this:


> \
> \
> \
> D R A W E R S i c o n\
> \
> [ optica optima ]\
> http://optica-optima.blogspot.com/\
> 2007 Yasushi Chida, All Right Reserved.

This this once I hit Enter:

touch: http://optica-optima.blogspot.com/: No such file or directory
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 02:15 PM   #20
RaceTripper
macrumors 68030
 
RaceTripper's Avatar
 
Join Date: May 2007
Quote:
Originally Posted by Khryz View Post
After I put in the command then drag the file in I get this:


> \
> \
> \
> D R A W E R S i c o n\
> \
> [ optica optima ]\
> http://optica-optima.blogspot.com/\
> 2007 Yasushi Chida, All Right Reserved.

This this once I hit Enter:

touch: http://optica-optima.blogspot.com/: No such file or directory
That's not a file path. It looks like contents of a file. The argument to touch is a valid path to a local file, as in my example above.

It would serve you well to grab a copy of O'Reilly's "Learning the bash shell" because you are missing some really key concepts about using the Mac via a command shell.
RaceTripper is offline   0 Reply With Quote
Old Oct 31, 2010, 02:23 PM   #21
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
After I put in the command then drag the file in I get this:


> \
> \
> \
> D R A W E R S i c o n\
> \
> [ optica optima ]\
> http://optica-optima.blogspot.com/\
> 2007 Yasushi Chida, All Right Reserved.

This this once I hit Enter:

touch: http://optica-optima.blogspot.com/: No such file or directory
OK, that's not right. I think the files you want to drag are the "Drawers" that are currently appearing in the middle (rather than the front) each of your folders. Try it for "Drawer" file in your Downloads folder. This file is probably some sort of image file; maybe a .jpg
LPZ is offline   0 Reply With Quote
Old Oct 31, 2010, 02:28 PM   #22
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Yeah, that's what I did. I opened Finder .. went into the folder with the icon in it and dragged it into Terminal.

http://cl.ly/33RQ

Those are the Drawers that I use if anyone wants to quickly DL them and take a look .. obviously I am messing something up.
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 02:42 PM   #23
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
Yeah, that's what I did. I opened Finder .. went into the folder with the icon in it and dragged it into Terminal.

http://cl.ly/33RQ

Those are the Drawers that I use if anyone wants to quickly DL them and take a look .. obviously I am messing something up.
Please do this. In Terminal, enter

cd ~/Downloads; ls

and press return. The character before the final "s" above is a lowercase L.

Post what you get.
LPZ is offline   0 Reply With Quote
Old Oct 31, 2010, 02:48 PM   #24
Khryz
Thread Starter
macrumors 6502a
 
Join Date: Jan 2007
Quote:
Originally Posted by LPZ View Post
Please do this. In Terminal, enter

cd ~/Downloads; ls

and press return. The character before the final "s" above is a lowercase L.

Post what you get.
Quote:
Download .app Drawers.zip
All I have in my Downloads folder is that .zip file I uploaded. Did I pass? Lol.
Khryz is offline   0 Reply With Quote
Old Oct 31, 2010, 02:52 PM   #25
LPZ
macrumors 65816
 
Join Date: Jul 2006
Quote:
Originally Posted by Khryz View Post
All I have in my Downloads folder is that .zip file I uploaded. Did I pass? Lol.
Please repeat the process described earlier. Drag the file named Download .app from the Downloads folder into the Terminal window.

That should modify the date for that file.
LPZ is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > OS X

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Changing behavior of "Date Modified"/"Date Created" karohan OS X 2 Apr 26, 2011 04:29 PM
Powerpoint 2008 change "Date Modified" just by open PPT osplo Mac Applications and Mac App Store 5 Jul 31, 2009 01:51 PM
iTunes 7 keeps changing "date modified" date! vd0t Mac Applications and Mac App Store 1 Nov 10, 2008 01:17 AM
"Date Modified" order in Spotlight? Coffeeguy OS X 3 Mar 21, 2007 07:54 PM
Help -- files suddenly losing "Date Modified" akadmon OS X 0 Feb 26, 2007 10:04 PM


All times are GMT -5. The time now is 03:29 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC