Writes all current network input data to
a file using the format of an EPANET input file.

@param fileName name of the file where data is saved.
@throws EpanetException
559734
public void ENsaveinpfile( String fileName ) throws EpanetException {
        int err = epanet.ENsaveinpfile(fileName);
        checkError(err);
    }
1305724
public void ENopen( String input, String report, String outputBin ) throws EpanetException {
        int errcode = epanet.ENopen(input, report, outputBin);
        checkError(errcode);
    }
253760
def writetofile(self, filename):
        ''''''
        f = open(filename, "w")
        f.write(self.read())
        f.close()
1235202
public static void writeConfigFile(String fileName, boolean sortClasses) throws SQLException, IOException {
		List<Class<?>> classList = new ArrayList<Class<?>>();
		findAnnotatedClasses(classList, new File("."), 0);
		writeConfigFile(fileName, classList.toArray(new Class[classList.size()]), sortClasses);
	}
980120
@Override
    public void write(final File filename) throws DITAOTException {
        assert filename.isAbsolute();
        setCurrentFile(filename.toURI());
        super.write(filename);
    }
398819
def save(self, filename=None):
        
        filename = filename or self._filename
        o = open(filename, 'w')
        o.write(self.write())
        o.close()
589365
private void writeFile(final String fileName,
                         final byte[] bs,
                         final boolean append) throws IOException {
    FileOutputStream fstr = null;

    try {
      fstr = new FileOutputStream(fileName, append);
      fstr.write(bs);

      // Terminate key with newline
      fstr.write('\n');

      fstr.flush();
    } finally {
      if (fstr != null) {
        fstr.close();
      }
    }
  }
816556
public function writeFile(
        string $content,
        string $filename,
        string $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING,
        ?ErrorCorrectionLevel $ecLevel = null
    ) : void {
        file_put_contents($filename, $this->writeString($content, $encoding, $ecLevel));
    }
1269773
public void initFromFile(final String filename) {
		try (final InputStream is = new FileInputStream(filename)) {
			init(is);
		} catch (IOException e) {
			initBackToDefaults();
		}
	}
868969
static void save(KAFDocument kaf, String filename) {
	try {
	    File file = new File(filename);
	    Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF8"));
	    out.write(kafToStr(kaf));
	    out.flush();
	} catch (Exception e) {
	    System.out.println("Error writing to file");
	}
    }
1367632
public void readFile(String filename) throws ConverterException {
        try {
            content = "";
            final InputStream input = ResourceManager.getInputStream(filename);
            while (input.available() > 0) {
                content = content + (char) input.read();
            }
            input.close();
        } catch (Exception e) {
            throw new ConverterException(e);
        }
    }
753516
public static void delete(String filename) {
		File file = new File(filename);
		if(file.exists()){
			file.delete();
		}
	}
130272
public void writeToFile(StringBuffer content, String filename) throws NoSuchPathException, IOException{
		try {
			FileWriter input = new FileWriter(filename);
			input.write(content.toString(), 0, content.length());
			input.flush();
			input.close();
		} catch (FileNotFoundException e) {
			throw new NoSuchPathException(e);
		}
	}
1021936
public static void writeByteArrayToFile(final String filename, final byte[] byteArray)
		throws IOException
	{
		final File file = new File(filename);
		writeByteArrayToFile(file, byteArray);
	}
625224
public synchronized void setFilename(String filename)
    {
        if (filename!=null)
        {
            filename=filename.trim();
            if (filename.length()==0)
                filename=null;
        }
        
        if (isStarted() && _filename!=null && filename==null)
            _out=null;
        
        _reopen=isStarted() &&
            ((_filename==null && filename!=null)||
             (_filename!=null && !_filename.equals(filename)));
        _filename=filename;

        if (!isStarted() && _filename!=null)
            _out=null;
    }
1170964
public static void backup(final String filename) throws IOException {
        final File dest = createFile(filename);
        if (dest.exists()) {
            final File backupFile = generateBackupFilename(filename);
            LOGGER.debug("backing up file from " + filename + " to "
                    + backupFile.getName());
            if (!dest.renameTo(backupFile)) {
                throw new IOException("Could not rename file from "
                        + dest.getName() + " to " + backupFile.getName());
            }
        }
    }
227041
public static void write(final String fileName, final BDD bdd) throws IOException {
    write(new File(fileName.endsWith(".dot") ? fileName : fileName + ".dot"), bdd);
  }