Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
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?
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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.
 

RaceTripper

macrumors 68030
May 29, 2007
2,867
178
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. ;)
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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.
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
Just curious before I attempt this but what's with the warning of not pressing Enter. Will that severely damage my computer or something?
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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 ...
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
Oh ok thanks you two.

I will try this and let you know if I need anymore help.
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
So, this isn't working. I am getting "No such file or directory" when I do this.

What am I doing wrong?
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
Hard to say if you don't show what it is you are doing (like the exact command you are invoking).

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.
 

RaceTripper

macrumors 68030
May 29, 2007
2,867
178
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.
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
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?
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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

macrumors 65816
Jul 11, 2006
1,221
2
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.
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1

RaceTripper

macrumors 68030
May 29, 2007
2,867
178
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.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
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.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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.
 

Khryz

macrumors 6502a
Original poster
Jan 7, 2007
940
1
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.

Download .app Drawers.zip

All I have in my Downloads folder is that .zip file I uploaded. Did I pass? Lol.
 

LPZ

macrumors 65816
Jul 11, 2006
1,221
2
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.