diff options
Diffstat (limited to 'OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs')
-rw-r--r-- | OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index ba23d82..7f0e2d6 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | |||
@@ -68,14 +68,22 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
68 | { | 68 | { |
69 | FileInfo fInfo = new FileInfo(path); | 69 | FileInfo fInfo = new FileInfo(path); |
70 | long numBytes = fInfo.Length; | 70 | long numBytes = fInfo.Length; |
71 | FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read); | 71 | if (fInfo.Exists) |
72 | byte[] idata = new byte[numBytes]; | 72 | { |
73 | BinaryReader br = new BinaryReader(fStream); | 73 | |
74 | idata = br.ReadBytes((int) numBytes); | 74 | FileStream fStream = new FileStream(path, FileMode.Open, FileAccess.Read); |
75 | br.Close(); | 75 | byte[] idata = new byte[numBytes]; |
76 | fStream.Close(); | 76 | BinaryReader br = new BinaryReader(fStream); |
77 | info.Data = idata; | 77 | idata = br.ReadBytes((int)numBytes); |
78 | //info.loaded=true; | 78 | br.Close(); |
79 | fStream.Close(); | ||
80 | info.Data = idata; | ||
81 | //info.loaded=true; | ||
82 | } | ||
83 | else | ||
84 | { | ||
85 | m_log.ErrorFormat("[ASSETS]: file: [{0}] not found !", path); | ||
86 | } | ||
79 | } | 87 | } |
80 | 88 | ||
81 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) | 89 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) |