Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • using tmp files with project package

    Hi all,

    I am attempting to organize my data analysis project using the package -project- by Robert Picard.

    In a nested do-file, I calculate the distance of households to the closest mobile money agent via the -geonear- command, which generates a temp file.
    Code:
      geonear hhid latitude longitude using "`pdir'\data\agents\Agents07.dta", n(agentid agentlat agentlong)
    Whenever I build the project, I get the error message 'file C:\Users\u1808714\AppData\Local\Temp\ST_1f18_00000 q.tmp already exists'. However, when I manually run the -geonear- command after loading the concerned file into Stata, it works perfectly.

    For background information (not sure if this is relevant to my problem): I have a dataset and a nested do-file for each of the survey years 2012, 2009 and 2007, which I later append to create panel data. I run the -genonear- command for the 2012 dataset and 2009 dataset via their respective do-files,
    Do-file 2012 contains
    Code:
     geonear hhid latitude longitude using "`pdir'\data\agents\Agents12.dta", n(agentid agentlat agentlong)
    Do-file 2009 contains
    Code:
     geonear hhid latitude longitude using "`pdir'\data\agents\Agents09.dta", n(agentid agentlat agentlong)
    I do not receive an error message for these commands. Only then the project runs the do-file 2007 and I receive the mentioned error message. So I am a bit puzzled why it works for the first two files and not for the last one. Is it possible that the temp file already exists from earlier attempts to build the project?

    Not sure if I explained this well enough, so please feel free to ask questions. Thank you for your help!
    Best, Elizabeth

  • #2
    When I try to replicate the project via -project, replicate-, the error message 'file C:\Users\u1808714\AppData\Local\Temp\ST_1f18_00000 q.tmp already exists'. appears already for the first geonear command, i.e. in the 2012 do-file. I would assume the temp file exists from a previous build of the project. However, does that mean I can only build the project once and not replicate it on the same device? That would strike me as a bit odd.
    Has anyone ever worked with temp files in a project setting and has advice on how to deal with those? Would be greatly appreciated.

    Comment

    Working...
    X