From skostysh at princeton.edu  Sat Sep  7 02:38:29 2013
From: skostysh at princeton.edu (Scott Kostyshak)
Date: Fri, 6 Sep 2013 20:38:29 -0400
Subject: [Rd] Comments requested on "changedFiles" function
In-Reply-To: <CAE3=dmfoDtzNTwFgvn4pZ0b-cdsJVKJPDO8rtBxqJQbfdEHw-w@mail.gmail.com>
References: <522773AC.3030609@gmail.com>
	<CABz6aZeM3nv1fievjjvXdQ5p+xcD775d1xqCHNjojWn03Ay9Og@mail.gmail.com>
	<5227DA21.8000202@gmail.com>
	<CABz6aZcU1M4hie_-tRORoQmxtxsQ4uCfuxx1=FdTNn6QE6br_w@mail.gmail.com>
	<52299D8F.1000805@gmail.com> <522A1CE0.2020203@gmail.com>
	<522A312E.3040608@gmail.com>
	<CAE3=dmfoDtzNTwFgvn4pZ0b-cdsJVKJPDO8rtBxqJQbfdEHw-w@mail.gmail.com>
Message-ID: <CAE3=dme78rzE0zXxY8eFGsxfP0WcjuWyAFeTypLwVubmvWy0VQ@mail.gmail.com>

On Fri, Sep 6, 2013 at 7:40 PM, Scott Kostyshak <skostysh at princeton.edu> wrote:
> On Fri, Sep 6, 2013 at 3:46 PM, Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
>> On 06/09/2013 2:20 PM, Duncan Murdoch wrote:
>>>
>>> I have now put the code into a temporary package for testing; if anyone
>>> is interested, for a few days it will be downloadable from
>>>
>>> fisher.stats.uwo.ca/faculty/murdoch/temp/testpkg_1.0.tar.gz
>>
>>
>> Sorry, error in the URL.  It should be
>>
>> http://www.stats.uwo.ca/faculty/murdoch/temp/testpkg_1.0.tar.gz
>
> Works well. A couple of things I noticed:
>
> (1)
> md5sum is being called on directories, which causes warnings. (If this
> is not viewed as undesirable, please ignore the rest of this comment.)
> Should this be the responsibility of the user (by passing arguments to
> list.files)? In the example, changing
> fileSnapshot(dir, file.info=TRUE, md5sum=TRUE)
> to
> fileSnapshot(dir, file.info=TRUE, md5sum=TRUE, include.dirs=FALSE,
> recursive=TRUE")
>
> gets rid of the warnings. But perhaps the user just wants to exclude
> directories for the md5sum calculations. This can't be controlled from
> fileSnapshot.
>
> Or, should the "if (md5sum)" chunk subset "fullnames" using file_test
> or file.info to exclude directories (and then fill in the directories
> with NA)?
>
> (2)
> If I run example(changedFiles) several times, sometimes I get:
>
> chngdF> changedFiles(snapshot)
> File changes:
>       mtime md5sum
> file2  TRUE   TRUE
>
> and other times I get:
>
> chngdF> changedFiles(snapshot)
> File changes:
>       md5sum
> file2   TRUE
>
> I wonder why.

Putting the following in-between snapshot and writeBin in the example
leads to consistent output:

# allow for mtime to change
Sys.sleep(.1)

Scott

>
> Scott
>
>> sessionInfo()
> R Under development (unstable) (2013-08-31 r63780)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
>  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
>  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
>  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
>  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
>  [9] LC_ADDRESS=C               LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] testpkg_1.0
>
> loaded via a namespace (and not attached):
> [1] tools_3.1.0
>>
>
>
> --
> Scott Kostyshak
> Economics PhD Candidate
> Princeton University


--
Scott Kostyshak
Economics PhD Candidate
Princeton University



[Rd] Comments requested on "changedFiles" function
Scott Kostyshak