Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/src/sugar/datastore/datastore.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/sugar/datastore/datastore.py')
-rw-r--r--src/sugar/datastore/datastore.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sugar/datastore/datastore.py b/src/sugar/datastore/datastore.py
index 637c083..c3ca17d 100644
--- a/src/sugar/datastore/datastore.py
+++ b/src/sugar/datastore/datastore.py
@@ -214,9 +214,11 @@ class RawObject(object):
# to create hardlinks to jobject files
# and w/o this, it wouldn't work since we have file from mounted device
if self._file_path is None:
- self._file_path = tempfile.mktemp(
- prefix='rawobject',
- dir=os.path.join(env.get_profile_path(), 'data'))
+ data_path = os.path.join(env.get_profile_path(), 'data')
+ self._file_path = tempfile.mktemp(prefix='rawobject',
+ dir=data_path)
+ if not os.path.exists(data_path):
+ os.makedirs(data_path)
os.symlink(self.object_id, self._file_path)
return self._file_path