It only changes the creation time if the target time is before the original creation time. SetFile is part of the command line tools package which can be downloaded from developer.
In Mac OS X there appears to be four different timestamps associated with a file. These timestamps are not always updated independently from each other, but one can have some individual control with a bit of care and with use of touch , SetFile , and chown or chmod. To see this, let's experiment and create a new file from the command prompt :. The first date listed is last access time atime , the second is last modification time mtime , the third is last status change ctime , the fourth is time of file creation birth, Btime , see man lstat.
To modify modification time mtime and time of file creation Btime to a specified time use:. Apparently this also automatically updates the time of last status change ctime to the current system time! To modify only the time of last status change ctime to the current system time use for example:. This doesn't change the ownership of the file, but accesses the file's inode and records this as a time of last status change. Unfortunately, it is not possible to specify the time explicitly here other than by changing the computer's time In summary, to be able to change the four timestamps independently, one may use in this order for the last 3 :.
The command-line touch command works in Lion, but you need a little background on how to use it. Firstly, you need to type it in, it's not a utility that operates graphically in a window.
The place you type it in is an app called Terminal. You can find this in your Utilities folder, or use Spotlight search to find it. Once you start it, you get a command line window where you can type in commands. Just because you are typing doesn't mean it has anything to do with coding, but to someone new to "old fashioned" OS commands it can look a little intimidating. So, the command is called touch , and after the command you can pass various parameters, the only required one being the filename.
Typing the following will set the last modified date of the file to the current time:. Of course, you may need to find the file first, which could require further commands to get to it. More advanced usage of the touch command allows you to specify the time you want to set, rather than using the time at execution, set access instead of modification times etc.
This is what parameters like -t and others do. Some set the time to be the time of another file, some set it to go back, or forward in time by X amount, see here for more details , eg:. The following is from this page which is also useful reference, and a great example with some tips for those who are uncomfortable with file locations on the command line. Note that this will change both the date modified and date created attributes only if your file was created after the date you enter.
This is because a file cannot be modified before it has been created. If created before the date you set, only the modified date will be changed.
Open a Finder window and locate the file you wish to modify and drag and drop it into the Terminal window, it will then insert the file location using command line terminology. Greats hints here, in particular the last one from Lauri Ranta, answered Aug 21 at Now use your cursor to drag this file into the file.
You will notice that a path will be automatically added to the end of the line you just typed. The entire line should look like the one given below: d: Modify the Date and Path: Open a Finder window and locate the file you wish to modify.
Drag and drop the file into the Terminal window, the file and path will be added to the end of the line you just typed. How to batch update the date modified attribute of multiple files? Given below are the supplementary steps to batch update the date modified attribute of multiple files: a: Look into the Top Directory: First of all, confirm that all the files that you want to alter are in the top directory of the same folder.
Once you identify, drag them into the Terminal Window and release the cursor. To change how files are displayed in Finder windows, use the View menu in the menu bar, or the row of buttons at the top of the Finder window.
You can view files as icons , in a list , in columns , or in a gallery. And for each view, the View menu provides options to change how items are sorted and arranged, such as by kind, date, or size. Learn more about customizing views. When you view files in a gallery, you can browse your files visually using large previews, so it's easy to identify images, videos, and all kinds of documents. Gallery View in macOS Mojave even lets you play videos and scroll through multipage documents.
Earlier versions of macOS have a similar but less powerful gallery view called Cover Flow. Quick Actions appear at the bottom of the Preview pane and vary depending on the kind of file selected. To manage Quick Actions, click More , then choose Customize.
You can even create your own Quick Actions using Automator. Learn more about Stacks. The sidebar in Finder windows contains shortcuts to AirDrop, commonly used folders, iCloud Drive, devices such your hard drives, and more. Like items in the Dock, items in the sidebar open with just one click.
You can also drag files into or out of the sidebar. Learn more about customizing the sidebar. To search with Spotlight, click the magnifying glass in the menu bar, or press Command—Space bar. Spotlight is similar to Quick Search on iPhone or iPad. Learn more about Spotlight. When you select a search result, its location appears at the bottom of the window. To move a file to the Trash, drag the file to the Trash in the Dock.
To remove a file from the Trash, click the Trash to open it, then drag the file out of the Trash. The storage space used by those files then becomes available for other files.
In macOS Sierra, you can set up your Mac to empty the trash automatically. Every file you create or modify on Windows 10 has file attributes attached to it, telling you or somebody else when the file was created, modified, opened, and possibly more.
If you want to change file attributes like these, you have a few options. You can use the new Windows PowerShell to change or remove this data, or you can do it using Windows File Explorer or another third-party app like Attribute Changer. If you want to change the last modified date or other file attributes on Windows 10, your first thought may be to do so using the Properties menu for a file in Windows File Explorer.
It will remove other personal data, however, such as author name for documents, ratings for media files, as well as set a file to read-only or hidden.
0コメント