My favorites | Sign in
Project Logo
                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from System.IO.IsolatedStorage import (
IsolatedStorageFile, IsolatedStorageFileStream
)

from System.IO import (
FileMode, StreamReader, StreamWriter
)


def CheckForFile(filename):
store = IsolatedStorageFile.GetUserStoreForApplication()
return store.FileExists(filename)


def DeleteFile(filename):
store = IsolatedStorageFile.GetUserStoreForApplication()
store.DeleteFile(filename)


def SaveFile(filename, data):
store = IsolatedStorageFile.GetUserStoreForApplication()
isolatedStream = IsolatedStorageFileStream(filename, FileMode.Create, store)

writer = StreamWriter(isolatedStream)
writer.Write(data)

writer.Close()
isolatedStream.Close()


def LoadFile(filename):
store = IsolatedStorageFile.GetUserStoreForApplication()
isolatedStream = IsolatedStorageFileStream(filename, FileMode.Open, store)

reader = StreamReader(isolatedStream)
data = reader.ReadToEnd()

reader.Close()
isolatedStream.Close()

return data

Show details Hide details

Change log

r125 by fuzzyman on Oct 08, 2009   Diff
Further improvements to the file type.
Almost API complete. Some attributes need
to become properties and docstrings need
adding.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1005 bytes, 42 lines
Hosted by Google Code