Why can't I copy data to a drive's root?

594
2
Jump to solution
03-20-2012 09:42 AM
RyanKelso
Occasional Contributor III
If I try to use geoprocessing, either with a script, toolbox, or whatever, to copy a shapefile to a drive's root, it doesn't work.  For example, copy input - C:\workspace\shapefile.shp, copy output - C:\shapefile_copy.shp.  The process says it is successful but it doesn't actually create the files.  Why doesn't this work?  Whether or not people should be putting data in a drive's root is not relevant.

For an example, my office network creates a network drive (U:) mapped to a personal folder for everybody in the office.  I can't use geoprocessing to copy a shapefile directly into U:\.  Not that I do this, I would rather put data into a folder within a drive, but this should still be possible.  I don't think it is any kind of permissions issue as I have full control to these drives, I can create, copy and delete things from these root "directories" using the windows file system.

The reason this is even a problem that came up is because if I create a model, add-in, or whatever that allows the user to choose a folder for output and for whatever reason they choose a drive's root then it won't work or might even throw an error.  Has anyone run into this before?
0 Kudos
1 Solution

Accepted Solutions
BarbaraBicking
Occasional Contributor
If I try to use geoprocessing, either with a script, toolbox, or whatever, to copy a shapefile to a drive's root, it doesn't work.  For example, copy input - C:\workspace\shapefile.shp, copy output - C:\shapefile_copy.shp.  The process says it is successful but it doesn't actually create the files.  Why doesn't this work?  Whether or not people should be putting data in a drive's root is not relevant.

For an example, my office network creates a network drive (U:) mapped to a personal folder for everybody in the office.  I can't use geoprocessing to copy a shapefile directly into U:\.  Not that I do this, I would rather put data into a folder within a drive, but this should still be possible.  I don't think it is any kind of permissions issue as I have full control to these drives, I can create, copy and delete things from these root "directories" using the windows file system.

The reason this is even a problem that came up is because if I create a model, add-in, or whatever that allows the user to choose a folder for output and for whatever reason they choose a drive's root then it won't work or might even throw an error.  Has anyone run into this before?



Hi Ryan,

This is by design and it's dictated by the IWorkspaceFactory interface that does not support writing to the root of a drive.

Barbara

View solution in original post

0 Kudos
2 Replies
BarbaraBicking
Occasional Contributor
If I try to use geoprocessing, either with a script, toolbox, or whatever, to copy a shapefile to a drive's root, it doesn't work.  For example, copy input - C:\workspace\shapefile.shp, copy output - C:\shapefile_copy.shp.  The process says it is successful but it doesn't actually create the files.  Why doesn't this work?  Whether or not people should be putting data in a drive's root is not relevant.

For an example, my office network creates a network drive (U:) mapped to a personal folder for everybody in the office.  I can't use geoprocessing to copy a shapefile directly into U:\.  Not that I do this, I would rather put data into a folder within a drive, but this should still be possible.  I don't think it is any kind of permissions issue as I have full control to these drives, I can create, copy and delete things from these root "directories" using the windows file system.

The reason this is even a problem that came up is because if I create a model, add-in, or whatever that allows the user to choose a folder for output and for whatever reason they choose a drive's root then it won't work or might even throw an error.  Has anyone run into this before?



Hi Ryan,

This is by design and it's dictated by the IWorkspaceFactory interface that does not support writing to the root of a drive.

Barbara

View solution in original post

0 Kudos
RyanKelso
Occasional Contributor III
Thank you for the answer!  I'm glad it wasn't just me going nuts!

But here is a problem with ESRI's implementation of IWorkspaceFactory not supporting writing to the root of a drive:  if you do define the output directory as the root of a drive for some process, it doesn't generate an error.  It reports the process as successful.  For example, just use the copy tool (data management) to copy a shapefile to C:\ and it claims to have succeeded yet the files weren't copied.
0 Kudos