Re: Utility to Strip Profiles without Changing Mod. Dates
Re: Utility to Strip Profiles without Changing Mod. Dates
- Subject: Re: Utility to Strip Profiles without Changing Mod. Dates
- From: Robert L Krawitz <email@hidden>
- Date: Fri, 29 Aug 2003 18:57:20 -0400
Date: Thu, 28 Aug 2003 09:41:50 -0400
From: Vic Paredes <email@hidden>
on 8/27/03 10:53 PM, Rick Gordon at email@hidden wrote:
> Can anyone recommend a utility (Mac or PC, but preferably Mac)
> which could strip embedded profiles from folders of CMYK
> graphics, while not altering the modification date (thus flagging
> a Quark update dialog -- and I don't want to have to modify each
> Quark file now to turn off the update dialog)?
File attributes are controlled by the operating system level. As
you may know, the OS records every bit of information about the
file (creation, modification, etc.). Once a file is opened AND
modified, the OS will update it so unless you can hack into the OS,
what you're attempting to do is impossible.
It wouldn't be hard to write some code to do this, if you know how to
strip the profile out. All you have to do is record the modification
time of the file, modify the file, and then reset the time. The code
would look something like this:
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
void
reset_file_time(const char *file)
{
struct stat statbuf;
if (stat(file, &statbuf) == 0)
{
struct timeval tv[2];
tv[0].tv_sec = statbuf.st_atime;
tv[1].tv_sec = statbuf.st_mtime;
tv[0].tv_usec = 0;
tv[1].tv_usec = 0;
strip_embedded_profiles(file);
if (utimes(file, tv) != 0)
perror("utimes");
}
}
--
Robert Krawitz <email@hidden>
Tall Clubs International --
http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail email@hidden
Project lead for Gimp Print --
http://gimp-print.sourceforge.net
"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
_______________________________________________
colorsync-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/colorsync-users
Do not post admin requests to the list. They will be ignored.