[FIXED] Re: Preserving file creation dates on [copyfile]

This WebDNA talk-list message is from

2007


It keeps the original formatting.
numero = 68425
interpreted = N
texte = Jesse- Actually, it was something a little more unusual- [shell] cp -p Conversions/WStarck_0001/Images/*.TIF Conversions/WStarck_0001/ ConvertedImages/[newfilename].TIF [/shell] [newfilename] was being provided higher on the page by an [include] like so: [text]newfilename=[include f../Includes/ImageConversion.inc][/text] The include contained a fairly hairy math equation, and therein was the error! I was assigning the results of a math equation to a text variable which was not providing a text string to the cp -p command, so it was ignoring the destination filename. So, I instead assigned the results of the math inside the include to a math variable, and then in turn assigned this result to a text variable like so: [math show=f]newimage=0[/math] [math show=f]newimage=[include ../Includes/ImageConverter.inc][/ math] [text show=f]newfilename=[newimage][/text] (all of this is inside a [listfiles] context, which changes the value of each imagename) This gave the cp command a text string for [newfilename], and it works as expected. Thanks Jesse, -Will On Feb 5, 2007, at 8:08 PMCST, Jesse Proudman wrote: > *.TIF is what's breaking it. > > You need to do 1 file per command. Batch it up with [loop] > > -- > > Jesse Proudman, Blue Box Group, LLC > > > > > On Feb 5, 2007, at 5:59 PM, WJ Starck wrote: > >> Jesse, >> >> [shell] >> cp -p Conversions/WStarck_0001/Images/*.TIF Conversions/ >> WStarck_0001/ConvertedImages/[newfilename].TIF >> [/shell] >> >> Copies the files in the Images folder to the ConvertedImages >> folder, but keeps the names the same... >> >> However, if I do the above directly from the command line, it works? >> >> -Will >> >> On Feb 5, 2007, at 7:44 PMCST, Jesse Proudman wrote: >> >>> cp -p should do that... What's your syntax? >>> >>> -- >>> >>> Jesse Proudman, Blue Box Group, LLC >>> >>> >>> >>> >>> On Feb 5, 2007, at 5:39 PM, WJ Starck wrote: >>> >>>> Well, that works, kinda sorta. >>>> >>>> Here is my snippet: >>>> >>>> >>>> [shell] >>>> rsync -t Conversions/WStarck_0001/Images/*.TIF Conversions/ >>>> WStarck_0001/ConvertedImages/[newfilename].TIF >>>> [/shell] >>>> >>>> What I want it to do is copy the file, preserve the modification >>>> date, *and* give it a new name. >>>> >>>> Right now, rsync (or cp -p for that matter), copies the file to >>>> the right destination while preserving the mod date, but the >>>> filename is not changed. >>>> >>>> Perhaps what I want to do is not possible? >>> >>> ------------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> To switch to the DIGEST mode, E-mail to >> digest@talk.smithmicro.com> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >> >> -- >> Will Starck >> NovaDerm Skincare Science >> http://www.novaderm.com >> helpdesk@novaderm.com >> 866-892-4149 >> >> >> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to > digest@talk.smithmicro.com> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ -- Will Starck NovaDerm Skincare Science http://www.novaderm.com helpdesk@novaderm.com 866-892-4149 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
Jesse- Actually, it was something a little more unusual- [shell] cp -p Conversions/WStarck_0001/Images/*.TIF Conversions/WStarck_0001/ ConvertedImages/[newfilename].TIF [/shell] [newfilename] was being provided higher on the page by an [include] like so: [text]newfilename=[include f../Includes/ImageConversion.inc][/text] The include contained a fairly hairy math equation, and therein was the error! I was assigning the results of a math equation to a text variable which was not providing a text string to the cp -p command, so it was ignoring the destination filename. So, I instead assigned the results of the math inside the include to a math variable, and then in turn assigned this result to a text variable like so: [math show=f]newimage=0[/math] [math show=f]newimage=[include ../Includes/ImageConverter.inc][/ math] [text show=f]newfilename=[newimage][/text] (all of this is inside a [listfiles] context, which changes the value of each imagename) This gave the cp command a text string for [newfilename], and it works as expected. Thanks Jesse, -Will On Feb 5, 2007, at 8:08 PMCST, Jesse Proudman wrote: > *.TIF is what's breaking it. > > You need to do 1 file per command. Batch it up with [loop] > > -- > > Jesse Proudman, Blue Box Group, LLC > > > > > On Feb 5, 2007, at 5:59 PM, WJ Starck wrote: > >> Jesse, >> >> [shell] >> cp -p Conversions/WStarck_0001/Images/*.TIF Conversions/ >> WStarck_0001/ConvertedImages/[newfilename].TIF >> [/shell] >> >> Copies the files in the Images folder to the ConvertedImages >> folder, but keeps the names the same... >> >> However, if I do the above directly from the command line, it works? >> >> -Will >> >> On Feb 5, 2007, at 7:44 PMCST, Jesse Proudman wrote: >> >>> cp -p should do that... What's your syntax? >>> >>> -- >>> >>> Jesse Proudman, Blue Box Group, LLC >>> >>> >>> >>> >>> On Feb 5, 2007, at 5:39 PM, WJ Starck wrote: >>> >>>> Well, that works, kinda sorta. >>>> >>>> Here is my snippet: >>>> >>>> >>>> [shell] >>>> rsync -t Conversions/WStarck_0001/Images/*.TIF Conversions/ >>>> WStarck_0001/ConvertedImages/[newfilename].TIF >>>> [/shell] >>>> >>>> What I want it to do is copy the file, preserve the modification >>>> date, *and* give it a new name. >>>> >>>> Right now, rsync (or cp -p for that matter), copies the file to >>>> the right destination while preserving the mod date, but the >>>> filename is not changed. >>>> >>>> Perhaps what I want to do is not possible? >>> >>> ------------------------------------------------------------- >>> This message is sent to you because you are subscribed to >>> the mailing list . >>> To unsubscribe, E-mail to: >>> To switch to the DIGEST mode, E-mail to >> digest@talk.smithmicro.com> >>> Web Archive of this list is at: http://webdna.smithmicro.com/ >> >> -- >> Will Starck >> NovaDerm Skincare Science >> http://www.novaderm.com >> helpdesk@novaderm.com >> 866-892-4149 >> >> >> >> >> >> ------------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> To switch to the DIGEST mode, E-mail to > digest@talk.smithmicro.com> >> Web Archive of this list is at: http://webdna.smithmicro.com/ > > > ------------------------------------------------------------- > This message is sent to you because you are subscribed to > the mailing list . > To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.com/ -- Will Starck NovaDerm Skincare Science http://www.novaderm.com helpdesk@novaderm.com 866-892-4149 ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ WJ Starck

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Dummy Credit Card Number for debug? (1997) embedded search vs. URL (2004) b12 cannot limit records returned and more. (1997) Attention all list readers (1997) restart needed???? (1997) MacWEEK article help needed (1996) newbies to web, spaces in email address (1998) Web Catalog 2 demo (1997) math on date? (1997) Bug Report, maybe (1997) default value from Lookup (was Grant, please help me) (1997) Progress !! WAS: Trouble with formula.db (1997) How to find 100 most recent additions. (1997) PCS Frames (1997) Search Trouble (2002) WebCat2 - Getting to the browser's username/password data (1997) How does WebCatalog search the database? (1997) major search problem (1998) WebCat2b13MacPlugin - nested [xxx] contexts (1997) Setting up shop (1997)