shutil.copyfile problem for GIS data

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmed, Shakir

    #1

    shutil.copyfile problem for GIS data


    Need help to copy a personal geodatabase from one location to another:


    Trying to copy a personal geodatabase from one location to another
    location where all the users are retrieving data from the second
    location:

    1. I can copy over the updated personal geodatabase to the working
    location and overwrite it, though the file is opened by ArcGIS users
    (Local Installation of Arc GIS on the users computers).


    2. But problem is that I can't copy over if the same updated
    personal geodatabase to the working location, if users uses that same
    geodatabase through CITRIX - ArcGIS ( user does not have permission to
    edit the data)

    3. the python script which I am using as follows:

    import shutil
    import os

    src = "c:\mydata\test \mygeo.mdb"
    dst = "v:\updated\dat a\mygeo.mdb"

    shutil.copyfile (src,dst)

    I highly appreciate if any one of you can help me and give me a
    direction that I can solve this problem.

    Thanks in advance.

    Shak
  • Larry Bates

    #2
    Re: shutil.copyfile problem for GIS data

    Ahmed, Shakir wrote:
    Need help to copy a personal geodatabase from one location to another:
    >
    >
    Trying to copy a personal geodatabase from one location to another
    location where all the users are retrieving data from the second
    location:
    >
    1. I can copy over the updated personal geodatabase to the working
    location and overwrite it, though the file is opened by ArcGIS users
    (Local Installation of Arc GIS on the users computers).
    >
    >
    2. But problem is that I can't copy over if the same updated
    personal geodatabase to the working location, if users uses that same
    geodatabase through CITRIX - ArcGIS ( user does not have permission to
    edit the data)
    >
    3. the python script which I am using as follows:
    >
    import shutil
    import os
    >
    src = "c:\mydata\test \mygeo.mdb"
    dst = "v:\updated\dat a\mygeo.mdb"
    >
    shutil.copyfile (src,dst)
    >
    I highly appreciate if any one of you can help me and give me a
    direction that I can solve this problem.
    >
    Thanks in advance.
    >
    Shak
    While I'm uncertain about the exact nature of your problem I can tell you that
    the src string you have defined won't work becaust \t is a tab character. To
    make shutil.copyfile work you need to do:

    src = r"c:\mydata\tes t\mygeo.mdb"
    dst = r"v:\updated\da ta\mygeo.mdb"

    or

    src = "c:\\mydata\\te st\\mygeo.mdb"
    dst = "v:\\updated\\d ata\\mygeo.mdb"


    -Larry

    Comment

    Working...