Reset the current position and open the file.
Note: This is called automatically on your first file access.
498685
public void open() throws DBException
    {
        m_bIsOpen = true;
        this.getRecord().setEditMode(Constants.EDIT_NONE);
        this.setDataSource(null);
    }
645081
def initialize(self, size=0):
        """"""
        fs, path = self._get_fs()

        # Required for reliably opening the file on certain file systems:
        if fs.exists(path):
            fp = fs.open(path, mode='r+b')
        else:
            fp = fs.open(path, mode='wb')

        try:
            fp.truncate(size)
        except Exception:
            fp.close()
            self.delete()
            raise
        finally:
            fp.close()

        self._size = size

        return self.fileurl, size, None
1324444
public function rewind()
	{
		// open file with reader
		// force UTF-8, validate XML, & substitute entities while reading
		$this->reader->open($this->file, 'UTF-8', XMLReader::VALIDATE | XMLReader::SUBST_ENTITIES);

		// fast forward to first record
		while ($this->reader->read() && $this->reader->name !== $this->key)
		{
			// Do nothing...
		}
	}
1267244
private void resetFile(String file) {
    File f = new File(file);
    if (f.exists()) {
      JMetalLogger.logger.info("Already existing file " + file);

      if (f.isDirectory()) {
        JMetalLogger.logger.info("Deleting directory " + file);
        if (f.delete()) {
          JMetalLogger.logger.info("Directory successfully deleted.");
        } else {
          JMetalLogger.logger.info("Error deleting directory.");
        }
      } else {
        JMetalLogger.logger.info("Deleting file " + file);
        if (f.delete()) {
          JMetalLogger.logger.info("File successfully deleted.");
        } else {
          JMetalLogger.logger.info("Error deleting file.");
        }
      }
    } else {
      JMetalLogger.logger.info("File " + file + " does NOT exist.");
    }
  }
757221
def reset_position(self):
        """"""
        self.pos = 0
        self.col = 0
        self.row = 1
        self.eos = 0
441499
public void openNextFile() {
		if( inputFilePath == null || inputMethod != InputMethod.IMAGE )
			return;

		String path;
		try {
			// need to remove annoying %20 from the path is there is whitespace
			path = URLDecoder.decode(inputFilePath, "utf-8");
		} catch (UnsupportedEncodingException e) {
			e.printStackTrace();
			return;
		}
		File current = new File(UtilIO.ensureURL(path).getFile());
		File parent = current.getParentFile();
		if( parent == null )
			return;

		File[] files = parent.listFiles();
		if( files == null || files.length <= 1 )
			return;
		File closest = null;

		for (int i = 0; i < files.length; i++) {
			File f = files[i];
			String name = f.getName().toLowerCase();
			// filter out common non image/video files
			if( name.endsWith(".txt") || name.endsWith(".yaml") || name.endsWith(".xml"))
				continue;

			if( current.compareTo(f) < 0 ) {
				if( closest == null || closest.compareTo(f) > 0 ) {
					closest = f;
				}
			}
		}

		if( closest != null && closest.isFile() ) {
			openFile(closest);
		} else {
			if( closest != null ) {
				System.err.println("Next file isn't a file. name="+closest.getName());
			} else {
				System.err.println("No valid closest file found.");
			}
		}
	}
900744
def on_m_open_file(self,event):
        '''
        
        '''
        dlg = wx.FileDialog(
            self, message="choose orient file",
            defaultDir=self.WD,
            defaultFile="",
            style=wx.FD_OPEN | wx.FD_CHANGE_DIR
            )
        if dlg.ShowModal() == wx.ID_OK:
            orient_file = dlg.GetPath()
            dlg.Destroy()
            new_data, dtype, keys = pmag.magic_read_dict(orient_file,
                                                         sort_by_this_name="sample_name",
                                                         return_keys=True)

            if len(new_data) > 0:
                self.orient_data={}
                self.orient_data=new_data
            #self.create_sheet()
            self.update_sheet()
            print("-I- If you don't see a change in the spreadsheet, you may need to manually re-size the window")
951854
def reopen(self, file_obj):
        """"""
        file_obj.open('U')
        if sys.version_info[0] <= 2:
            return file_obj
        else:
            return codecs.getreader('utf-8')(file_obj)
1134888
def rewind(self):
        ''''''
        if self.mode != READ:
            raise OSError("Can't rewind in write mode")
        self.fileobj.seek(0)
        self._new_member = True
        self.extrabuf = b""
        self.extrasize = 0
        self.extrastart = 0
        self.offset = 0
1163579
public function reset()
    {
        if (!$this->markSupported()) {
            throw new IOException(get_class($this) . " does not support mark() and reset() methods.");
        }
        // goes back to last mark, by default this would be 0 (i.e. rewind file).
        fseek($this->stream, SEEK_SET, $this->mark);
        $this->mark = 0;
    }
869874
private void seekToRestartPosition(int restartPosition)
    {
        checkPositionIndex(restartPosition, restartCount, "restartPosition");

        // seek data readIndex to the beginning of the restart block
        int offset = restartPositions.getInt(restartPosition * SIZE_OF_INT);
        data.setPosition(offset);

        // clear the entries to assure key is not prefixed
        nextEntry = null;

        // read the entry
        nextEntry = readEntry(data, null);
    }
469144
function startFile() {
      saveBlock();
      saveFile();

      currentFile = {};
      currentFile.blocks = [];
      currentFile.deletedLines = 0;
      currentFile.addedLines = 0;
    }
1335042
public void reset() {
        targetFile = null;
        title = null;
        defaultTitle = null;
        inTitleElement = false;
        termStack.clear();
        topicIdStack.clear();
        indexTermSpecList.clear();
        indexSeeSpecList.clear();
        indexSeeAlsoSpecList.clear();
        indexSortAsSpecList.clear();
        topicSpecList.clear();
        indexTermList.clear();
        processRoleStack.clear();
        processRoleLevel = 0;
        titleMap.clear();
    }
1330694
def reset(self):
        
        if os.path.exists(self.index_dir):
            rmtree(self.index_dir)
        self.index = None
275715
def _filehandle(self):
        
        # if file is opened and it has been rolled we need to close the file
        # and then to reopen it
        if self._fh and self._has_file_rolled():
            try:
                self._fh.close()
            except Exception:
                pass

            self._fh = None

        # if the file is closed (or has been closed right now), open it
        if not self._fh:
            self._open_file(self.filename)

            if not self.opened_before:
                self.opened_before = True
                self._fh.seek(0, os.SEEK_END)

        return self._fh
1545
public void reset() {
        fileLink = null;
        formFragment = new FormFragment();
        getSupportFragmentManager()
                .beginTransaction()
                .replace(R.id.root, formFragment)
                .commit();
    }
1019745
def reopen(self):
        
        self._FITS.close()
        del self._FITS
        self._FITS = _fitsio_wrap.FITS(self._filename, self.intmode, 0)
        self.update_hdu_list()