Re: Mogrify -preserve implementation

Niko Rosvall <[email protected]> Tue, 23 Feb 2016 19:19:10 +0200
Newsgroups gmane.comp.video.graphicsmagick.core
Message-ID <[email protected]>
On 02/23/2016 04:47 PM, Bob Friesenhahn wrote:
> On Tue, 23 Feb 2016, Niko Rosvall wrote:
> 
>> Hi,
>>
>> I wrote a fairly naive implementation to keep file timestamps when
>> running mogrify. I added an option -preserve to the command mogrify.
>>
>> By no means it's not perfect as it does not care about Windows. I hardly
>> use Windows at all, so it fairly hard for me to implement support for
>> it. However, I'm willing to do it, if this is a feature that GM wants to
>> include.
> 
> Few of us love Windows, but we are dedicated to making sure that 
> GraphicsMagick Windows users are well supported within the 
> capabilities of the operating system.
> 
>> Some questions: Would it be better to implement the actual code into
>> separate files (now it's just all in magick/command.c). Maybe
>> magic/preserve.c?
> 
> What is currently typically done is to put Unix-specific code in 
> magick/unix_port.c and Windows-specific code in magick/nt_base.c. 
> Similar functions added to each place can allow a common 
> implementation in magick/command.c to work.
> 
> The magick/studio.h header provides a MagickFstat() macro which 
> provides porting definitions.  Windows does provide fstat as well as a 
> a _fstati64() function (for large files).  I am not sure how one sets 
> file timestamps under Windows.
> 
> Bob
> 

Thanks!

I did take a look, and it's not too hard to set timetamps on Windows, so
I will take a closer look and send a better patch later! Thanks for the
instructions. :)

Niko

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140