2009/10/30 16:58 You need
크리에이티브 커먼즈 라이선스
Creative Commons License

 

PSFTP는 PuTTY SFTP의 약자입니다.

파일을 전송할 때 굉장히 유용합니다.

 

 

PuTTY Download Page :

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

위 사이트에 가시면 "PuTTY", "PSFTP", "PSCP", 등등 많은 tool이 있습니다.

 

일단 PSFTP를 다운 받으시고, path를 설정하셔서 command를 이용할 수도 있고, 그냥 마우스 더블 클릭으로 사용하셔도 됩니다.

 

아래 사이트에는 PSFTP 사용법에 대하여 나와 있습니다.

Using PSFTP to transfer files securely

저는 간단히 파일을 주고 받는 방법만 서술 하겠습니다.

 

6.2.4 The help command: get quick online help
If you type help, PSFTP will give a short list of the available commands.

If you type help with a command name - for example, help get - then PSFTP will give a short piece of help on that particular command

- PSFTP를 실행하시고 "help"를 입력하면 명령어에 대한 설명이 간단하게 나옵니다. 이것을 보시면 어느 정도 사용 방법을 알 수 있습니다.

 

 

6.2.2 The open command: start a session
If you started PSFTP by double-clicking in the GUI, or just by typing psftp at the command line, you will need to open a connection to an SFTP server before you can issue any other commands (except help and quit).

To create a connection, type open host.name, or if you need to specify a user name as well you can type open user@host.name.

Once you have issued this command, you will not be able to issue it again, even if the command fails (for example, if you mistype the host name or the connection times out). So if the connection is not opened successfully, PSFTP will terminate immediately.

- 간단히 설명하면 PSFTP를 실행시키고, open xxx.xxx.xxx.xxx. 하시면 sftp서버에 접속이 됩니다.

 

 

6.2.7 The get command: fetch a file from the server
To download a file from the server and store it on your local PC, you use the get command.

In its simplest form, you just use this with a file name:

get myfile.dat
If you want to store the file locally under a different name, specify the local file name after the remote one:

get myfile.dat newname.dat
This will fetch the file on the server called myfile.dat, but will save it to your local machine under the name newname.dat.

- get "파일명" 하시면 원하시는 파일을 local computer로 가져오실 수 있습니다.

 

 

6.2.8 The put command: send a file to the server
To upload a file to the server from your local PC, you use the put command.

In its simplest form, you just use this with a file name:

put myfile.dat
If you want to store the file remotely under a different name, specify the remote file name after the local one:

put myfile.dat newname.dat
This will send the local file called myfile.dat, but will store it on the server under the name newname.dat.

- put "파일명" 하시면 원하시는 파일을 remote server(sftp server)로 전송할 수 있습니다.

 

 

 

 

 

 

 

 

'You need' 카테고리의 다른 글

[dll] msvcr71.dll  (0) 2010/03/02
[exe4j] java exe파일 만들기  (0) 2010/02/05
[tool] psftp 사용  (0) 2009/10/30
[tip] Excel 창 여러개 열기  (10) 2009/10/16
[link]영문 무료 폰트 다운로드  (4) 2009/07/15
윈도우7 테마 : Seven-RemixXP  (2) 2009/06/08
posted by 조금까칠한남자
2009/08/10 13:13 MiPlatform
크리에이티브 커먼즈 라이선스
Creative Commons License
이번에는 현재 개발하고 있는 프로그램의 유지 보수를 편하게 하기 위하여 숨은 기능을 구현하였습니다.
따로 버튼을 만들지 않고 숨은 단축키를 누르면 기능이 구현되도록 하였습니다.

Text 파일 내리기.
File0.filename = "c:\\GeneralHistory.txt";
    if( File0.open("a+") )
    {           
        //WRITE(buf, bufsize)
        //buf : 내용
        //bufsize : write할 길이.. NULL이면 buf 전체 길이
        var strText = replace(ds_selectlist_dt.SaveCSV(),'"',"");
        var len = File0.write(substr(strText,100,length(strText)));       
        File0.close();
    }

File component를 이용해서 text파일에 write하는 기능입니다.
고객의 정보 보호를 위하여 화면 캡쳐는 하지 않았습니다.
그냥 저 소스 이용하시면 바로 dataset의 내용을 SaveCSV()를 이용하여 txt파일에 write할 수 있습니다.

또는 SaveCSV()를 이용하지 않고, dataset의 내용을 하나의 String으로 만들어서 text파일에 사용하는 방법이 있습니다.
var text = "";
for( var i=0; i < ds_selectlist_dt.GetRowCount(); i++)
{
    for( var j=0; j< ds_selectlist_dt.GetColCount(); j++)
    {
        text += "      " + ds_selectlist_dt.GetColumn(i, j);
    }
    text+= "\n";
}
  
var buffer = text;  

File0.filename = "c:\\GeneralHistory.txt";
if( File0.open("rw") )
{          
    var len = File0.write(buffer);      
    File0.close();
}


아래 이미지는 오늘 날씨가 너무 더워서.... ㅎㅎ


posted by 조금까칠한남자
2009/03/28 16:23 CodeIN/Java
크리에이티브 커먼즈 라이선스
Creative Commons License

흠... File.separator 처럼 만들어주는 메소드이다.

가끔 어떤 플랫폼에서 file path를 가져오면은 제대로 작동하지 않는 경우가 있는데..

그냥 이렇게 해서 사용한다.

 

 private static String changeDivision(String filePath){
//        System.out.println("----------------------------------------------changeDivision");
        String ret = "";
//        System.out.println("filePath : " + filePath);
        ret = filePath.replaceAll("
\\\\", "/");
//        System.out.println("ret : " + ret);
        return ret;
    }

 

 

 

 

 

 

'CodeIN > Java' 카테고리의 다른 글

jConsole 사용하기  (2) 2009/07/30
Sun unveils JavaFX apps, Photo Flocker, Movie Cloud  (1) 2009/05/28
[java] File.separator  (0) 2009/03/28
[ant] ant  (0) 2009/03/20
[java] toString()  (0) 2009/03/20
[java] super / super() 를 사용하는 이유.  (0) 2009/03/20
posted by 조금까칠한남자
2009/02/09 13:50 CodeIN/Web
크리에이티브 커먼즈 라이선스
Creative Commons License
휴~
사용할 때마다 찾아서 쓰는 것보다 정리 해놓는게 좋을 것 같아서 하나씩 정리를 해본다.

아래 소스는 File을 선택하는 소스이다.
이런 간단한 것들은 앞으로 정리 좀 해두어야 겠다^^;;
소스 설명할 필요가 없을 정도로 간단하다.

<span style="font:bold 11pt Verdana;">
        <h2>근무시간 File:</h2>
        <form name="fileChooser" method="post" action="ReadFile.jsp">
            <input type="file" name="filePath" size="80"><br>
            <input type="submit" name="submit" value="파일 읽기">
            <input type="reset" name="reset" value="취소">
        </form>
</span>   



posted by 조금까칠한남자
2008/10/30 17:42 CodeIN/Java
크리에이티브 커먼즈 라이선스
Creative Commons License
public String[] getMPPList(){
       String[] ret=null;
       File vpms = new File(mppListPath);
       //vpms에서 "MPP"로 시작하는 디렉토리만 추출
       String[] list = vpms.list(new FilenameFilter(){
           public boolean accept(File arg0, String arg1) {
               // TODO Auto-generated method stub
               if( arg1.startsWith(prefix_MPP)){
                   return true;
               }else{
                   return false;
               }                
           }            
       });
       
       for(int i=0 ; i < list.length ; i++){            
           System.out.println(list[i]);        
       }
       return ret;
   }
   private final String mppListPath = "C:\\";
   private final String prefix_MPP="MPP";

'CodeIN > Java' 카테고리의 다른 글

[java]ini 파일 읽기  (0) 2009/02/11
Each path on WEB  (1) 2008/11/05
[java]FilenameFilter 사용법  (0) 2008/10/30
[java]native2ascii 사용법  (0) 2008/10/24
[Java] Runtime class 사용예제  (0) 2008/10/18
[Java]System 정보를 읽어오는 코드  (0) 2008/10/18
posted by 조금까칠한남자
2008/10/28 09:39 Operating System/Linux
크리에이티브 커먼즈 라이선스
Creative Commons License
리눅스 상에서 top를 실행하면 일정한 주기로 refresh된다.

top을 실행한 후에 이를 다른 프로그램으로 보내주거나 파일로 저장하기 위해서 옵션을 넣어주면 된다.

먼저 man top를 해보자.
중요하게 봐두어야 할 것은 다음 두 옵션이다.

-b : Batch mode operation
            Starts  top  in  ’Batch  mode’, which could be useful for sending output from top to other programs or to a file.  In
            this mode, top will not accept input and runs until the iterations limit you’ve set with the ’-n’ command-line option
            or until killed.

-n : Number of iterations limit as:  -n number
            Specifies the maximum number of iterations, or frames, top should produce before ending.

그냥 top명령어를 입력하는 것과 top -b 옵션으로 입력한 결과 값이 틀리다는 것은 알 수 있을 것이다.


posted by 조금까칠한남자
TAG file, Java, linux, Man, Top
2008/09/16 16:32 CodeIN/Python
크리에이티브 커먼즈 라이선스
Creative Commons License
def make_directory():
    try:
        ex=os.path.exists(LOG_PATH)
        if ex == False:            
            os.mkdir(LOG_PATH)
            write_log("CheckAVSLogs directory is created")        
        else:            
            print "the LOG_PATH is exist : ", ex
    except IOError, e:
        print IOError   
             

'CodeIN > Python' 카테고리의 다른 글

[python]urlopen, random  (0) 2008/09/21
[python]echoserver, echoclient  (0) 2008/09/20
[python]os.popen 이용하기  (3) 2008/09/17
[python]httplib  (2) 2008/09/17
[python]directory가 존재하는지 체크  (0) 2008/09/16
[python] file 읽기  (1) 2008/09/16
posted by 조금까칠한남자
2008/09/16 13:30 CodeIN/Python
크리에이티브 커먼즈 라이선스
Creative Commons License
try:

#파일의 fullpath입력시 왜 마지막에는 "\\" 을 사용해야 하는가...흠흠..  
  f=open("D:\imhotk_Flagship\Ganymede\workspace\HelloWorld\src\imhotkLIB\\avs.log", 'r')
    currentPoint=f.tell()
    print "currentPoint : ", currentPoint    
except IOError, e:
    print e
    exit()

while 1:
    line=f.readline()
    currentPoint=f.tell()
    print currentPoint
    if not line:
        break
    
print "end of file"

'CodeIN > Python' 카테고리의 다른 글

[python]urlopen, random  (0) 2008/09/21
[python]echoserver, echoclient  (0) 2008/09/20
[python]os.popen 이용하기  (3) 2008/09/17
[python]httplib  (2) 2008/09/17
[python]directory가 존재하는지 체크  (0) 2008/09/16
[python] file 읽기  (1) 2008/09/16
posted by 조금까칠한남자
TAG file, python
2008/09/06 16:22 CodeIN/Java
크리에이티브 커먼즈 라이선스
Creative Commons License
    File selectedFile = null;  

    JFileChooser jfc = new JFileChooser(CommonVars.AVS_DIRECTORY);
   
    jfc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    int returnVal = jfc.showOpenDialog(null);

    if( returnVal == JFileChooser.APPROVE_OPTION){
        selectedFile = jfc.getSelectedFile();
        System.out.println("selectedFile : " + selectedFile);
    } 

'CodeIN > Java' 카테고리의 다른 글

log4j 사용법  (0) 2008/09/06
LogManager class - log4j  (0) 2008/09/06
[How to use] JFileChooser  (0) 2008/09/06
JAVA XML  (0) 2008/08/15
[How to use]JAVA FileFilter  (2) 2008/08/13
[펌]Java Properties 사용하기  (0) 2008/08/04
posted by 조금까칠한남자
prev 1 next