summaryrefslogtreecommitdiff
path: root/fs/memoryfs.py
diff options
context:
space:
mode:
authorwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-01-01 20:18:32 +0000
committerwillmcgugan <willmcgugan@67cdc799-7952-0410-af00-57a81ceafa0f>2010-01-01 20:18:32 +0000
commit671cf321fcc774c03d093fbae257e71b1df3d0ea (patch)
treee371fce423086808958d373d869b3fc66ef3e431 /fs/memoryfs.py
parentbb120439de4f17426e17cd4d0782295c8192a869 (diff)
downloadpyfilesystem-671cf321fcc774c03d093fbae257e71b1df3d0ea.tar.gz
Documentation, fixes, A ReadOnlyFS wrapper and a plain old FTP FS class
git-svn-id: http://pyfilesystem.googlecode.com/svn/trunk@309 67cdc799-7952-0410-af00-57a81ceafa0f
Diffstat (limited to 'fs/memoryfs.py')
-rw-r--r--fs/memoryfs.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/fs/memoryfs.py b/fs/memoryfs.py
index 22f5059..36d997e 100644
--- a/fs/memoryfs.py
+++ b/fs/memoryfs.py
@@ -1,15 +1,18 @@
#!/usr/bin/env python
"""
+fs.memoryfs
+===========
- fs.memoryfs: A filesystem that exists only in memory
+A Filesystem that exists in memory only.
-Obviously that makes this particular filesystem very fast...
+File objects returned by MemoryFS.objects use StringIO objects for storage.
"""
import datetime
from fs.path import iteratepath
from fs.base import *
+from fs import _thread_syncronize_default
try:
from cStringIO import StringIO
@@ -166,12 +169,18 @@ class DirEntry(object):
class MemoryFS(FS):
+
+ """ An in-memory filesystem.
+
+ MemoryFS objects are very fast, but non-permantent. They are useful for creating a directory structure prior to writing it somewhere permanent.
+
+ """
def _make_dir_entry(self, *args, **kwargs):
return self.dir_entry_factory(*args, **kwargs)
def __init__(self, file_factory=None):
- FS.__init__(self, thread_synchronize=True)
+ FS.__init__(self, thread_synchronize=_thread_syncronize_default)
self.dir_entry_factory = DirEntry
self.file_factory = file_factory or MemoryFile