Free pascal에서 SQLite 사용하기
Free Pascal이나 Lazarus에 기본으로 있는 sqlite 관련 컴포넌트를 리눅스 환경에서 사용할 경우 Close나 Free를 호출할 경우 알…
Free Pascal이나 Lazarus에 기본으로 있는 sqlite 관련 컴포넌트를 리눅스 환경에서 사용할 경우 Close나 Free를 호출할 경우 알…
Introduction Musical instrument signals generally consist of a transient portion and steady state or quasi-periodic portion. The…
DB2 UDBMySQLOraclePostgreSQLSQL ServerSQL Server (open source driver)SQLiteSybase 출처: http://www.smithproject.org/smith_download.cfm
TIME-WAIT 상태란, 연결 종료 시 마지막 패킷 전송 실패를 대비하기 위한 상태이다. TCP 연결 종료과정은 four-way handshaking을…
파일을 주기적으로 백업하는 배치 파일 등을 작성하다 보면 날짜를 계산하거나 특정 파일에 저장된 날짜를 읽어들여 그 날짜를…
tomcat pid를 찾아서 강제 종료시키고, 다시 시작시키는 쉘 스크립트입니다. 간혹 shutdown.sh로 종료가 안되는 경우가 있는데.. 이럴 경우에…
X connection to localhost:10.0 broken (explicit kill or server shutdown). Starting RapidMiner using the non-GUI script named…
1 2 3 |
package some.package;<br /><br />import java.io.BufferedInputStream;<br />import java.io.BufferedOutputStream;<br />import java.io.File;<br />import java.io.FileInputStream;<br />import java.io.FileOutputStream;<br />import java.io.FileNotFoundException;<br />import java.io.IOException;<br /><br />/**<br /> * This class contains static methods that perform <br />operations on files<br /> * Due to limitations of File objects across NFS mounted <br />filesystems<br /> * this class provides a workaround<br /> *<br /> */<br /><br />public final class FileUtils<br />{<br /> /** Private constructor to prevent instantiation.<br /> * All of the methods of this class are static.<br /> */<br /> private FileUtils()<br /> {<br /> //prevent instantiation;<br /> }<br /><br /> /** Copy a File<br /> * The renameTo method does not allow action across NFS <br />mounted filesystems<br /> * this method is the workaround<br /> *<br /> * @param fromFile The existing File<br /> * @param toFile The new File<br /> * @return <code>true</code> if and only if the renaming <br />succeeded;<br /> * <code>false</code> otherwise<br /> */<br /> public final static boolean copy (File fromFile, File toFile)<br /> {<br /> try<br /> {<br /> FileInputStream in = new FileInputStream(fromFile);<br /> FileOutputStream out = new FileOutputStream(toFile);<br /> BufferedInputStream inBuffer = new BufferedInputStream<br />(in);<br /> BufferedOutputStream outBuffer = new <br />BufferedOutputStream(out);<br /><br /> int theByte = 0;<br /><br /> while ((theByte = inBuffer.read()) > -1)<br /> {<br /> outBuffer.write(theByte);<br /> }<br /><br /> outBuffer.close();<br /> inBuffer.close();<br /> out.close();<br /> in.close();<br /><br /> // cleanupif files are not the same length<br /> if (fromFile.length() != toFile.length())<br /> {<br /> toFile.delete();<br /> <br /> return false;<br /> }<br /> <br /> return true;<br /> }<br /> catch (IOException e)<br /> {<br /> return false;<br /> }<br /> }<br /><br /> /** Move a File<br /> * The renameTo method does not allow action across NFS <br />mounted filesystems<br /> * this method is the workaround<br /> *<br /> * @param fromFile The existing File<br /> * @param toFile The new File<br /> * @return <code>true</code> if and only if the renaming <br />succeeded;<br /> * <code>false</code> otherwise<br /> */<br /> public final static boolean move (File fromFile, File toFile)<br /> {<br /> if(fromFile.renameTo(toFile))<br /> {<br /> return true;<br /> }<br /><br /> // delete if copy was successful, otherwise move will fail<br /> if (copy(fromFile, toFile))<br /> {<br /> return fromFile.delete();<br /> }<br /><br /> return false;<br /> }<br />}<br /><br /><br />http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4073756<br /> |
출처: http://www.chazzuka.com/blog/index.php?p=47&t=jquery-vs-prototype-javascript-framework.html