- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: File creation times?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 09:53 AM
02-17-2003 09:53 AM
I have what i hope is a very simple question. How can I determine when a file was created?
TIA, Bob
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 09:56 AM
02-17-2003 09:56 AM
SolutionYour only real, reliable option is to carry that data in the filename itself or as part of the file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 10:01 AM
02-17-2003 10:01 AM
Re: File creation times?
There is no creation timestamp maintained. You can interrogate the 'modification' timestamp (which is equivalent to the creation one when the file is first created) with 'ls -l', but this timestamp changes if a file is opened and written to afterwards. The '-c' option of 'ls' tracks permission and ownership changes and the '-u' option of 'ls' offers the last-access timestamp.
Remember, any or all, of these timestamps can be manipulated with the 'touch' command. See the man pages for more information.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 10:23 AM
02-17-2003 10:23 AM
Re: File creation times?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 10:27 AM
02-17-2003 10:27 AM
Re: File creation times?
Well you could use various options of the date commands output to record the timestamp as a filename suffix. e.g. myfile.YYYYMMDDHHMMSS or Plan B. simply use the epoch seconds to do this.
SECONDS=$(perl -e 'print time')
The inverse would be
perl -e "print scalar localtime(${SECONDS})".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 11:42 AM
02-17-2003 11:42 AM
Re: File creation times?
forgive any errors, don't have a UX machine I can even look at today.
TIMESTAMP=`date`
FILENAME="Steves data file.%m%s%d.data"
...
create file using name
...
end of script.
There are dozens of options on exactly how you want to stamp the file. If my flu burned out neurons recall this information is in the documentaiton of the date command.
Someone correct or add on. I'm trying to get across a concept that needs to be in the thread, but I don't have a reference script here.
darn.
half a try.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com