PLEX86  x86- Virtual Machine (VM) Program
 Plex86  |  CVS  |  Mailing List  |  Download  |  Linux  |  Newsgroups

Creating a file with timestamp 4783


Your Ad Here

Your Ad Here

I'll leave to someone else the netiquette lesson about it being good to include some context to clue in people who might not have seen the message to which you're responding.

If you are creating a filename based on a timestamp, and the timestamp is in coarser granularity than the minimum period between attempts to make such a filename, then, yes, the filenames will not be unique.

Kodak.... 4784
On Wed, 14 Sep 2005 14:57:27 +0000, Grant Edwards I have both on my box. The usb cable todev-sdb1 which is my...

If you want them to be unique, then you could either use a finer-grained timestamp (microseconds perhaps) or add something to the name to make it unique. Depending on your situation, you could use a process ID, provided the same process wouldn't try to create multiple files (within the timestamp granularity. Or, you could write script or C code to add something of your choosing. For some of my sysadmin purposes, I manually append an 'a', 'b', 'c', and so forth to filenames whose names are based only on the date. For other tasks, I have a shell script that chooses the lowest three-digit number for which a file does not already exist.

Depending on your situation, it might be simplest to stuff in a 2-second delay (anything just a little over 1 second should actually suffice) in the right place to guarantee that you wouldn't be creating multiple files with the same timestamp.

Robert Riches (Yes, that is one of my email addresses.)



Your Ad Here

List | Previous | Next

Kodak.... 4784

Linux groups from Newsgroups

The #1 Usenet Provider on the Internet

Creating a file with timestamp 4782