OpenInputFileStream() public méthode

public OpenInputFileStream ( string path ) : Stream
path string
Résultat Stream
Exemple #1
0
 private static Stream OpenFile(CodeContext context, PlatformAdaptationLayer pal, string name, FileMode fileMode, FileAccess fileAccess, FileShare fileShare) {
     try {
         return pal.OpenInputFileStream(name, fileMode, fileAccess, fileShare);
     } catch (UnauthorizedAccessException e) {
         throw PythonFile.ToIoException(context, name, e);
     } catch (IOException e) {
         PythonFile.AddFilename(context, name, e);
         throw e;
     }
 }
 internal Stream GetStream(string path)
 {
     return(_pal.OpenInputFileStream(path));
 }
Exemple #3
0
 private static Stream OpenFile(PlatformAdaptationLayer pal, string name, FileMode fileMode, FileAccess fileAccess, FileShare fileShare) {
     if (pal.DirectoryExists(name)) {
         // TODO: properly set errno
         throw PythonOps.IOError("[Errno 13] Permission denied");
     }
     return pal.OpenInputFileStream(name, fileMode, fileAccess, fileShare);
 }