Writing to a unix system file

I need to write to a unix config file using Java, so I'm basically trying to do what sudo normally does. What is the proper way to pass the credentials and write to the file in Java?
This will be for a desktop application, so I'll be getting the sudo password from a swing element and then authenticating to allow writing a file.

You'll have to Runtime.exec sudo or a script that does sudo. You can't just directly have your Java code switch the identity of who's executing it midstream.

Similar Messages

  • How to run a JAR file in Unix system?

    hi there
    ca anyone tell me how to run a JAR file in unix system or X window, thank you

    You want to create an executable JAR file? You do it in the following way.
    Create a manifest file such as manif.txt and the contents should contain
    Main-Class: foo
    assuming foo is the name of your main class. Then create the jar as follows
    jar cvfm foo.jar manif.txt foo.class
    I hope that helps you!
    you can find more info here http://java.sun.com/docs/books/tutorial/jar/

  • Do you have solution to add a signature on PDF files on HPUX (unix) system

    Hello,
    My company plans tio use PDF files for our customers billings and we need to add signature to them.
    As our PDF files are generated on a HPUX (unix) system, and quite 10000 files a day will be generated, do you have a solution do add signature to thses files directly on our unix system ?
    Thank you for help.

    Hello,
    just to let you know that I had a contact with DataLogics who developped a new toolkit that seems to manage digital signature .
    Adobe PDF Java Toolkit http://www.datalogics.com/products/pdfjt/
    I will let you know the results of my tests in the next weeks.
    thanks.

  • How to import .tdms file to Matlab running in Unix system?

    I was using DAQmx to acquire 16 channels of sampled data to .tdms format and later on will need to import the data to a Matlab programme. My question is, the Matlab we have is installed in a Unix system. But the tdms to Matlab example given in NI website, as in the link below, has problem when i run it in Unix system.
    http://digital.ni.com/public.nsf/websearch/0EEADA9​9DC7D00A4862572E30037C3A2?opendocument&Submitted&&​...
    Errors occurred in the "loadlibrary" function. I was told that in Unix system, a different file instead of .dll file shall be used?
    Can anyone make an example to read tdms data,  that will work in a Matlab installed in Unix system?

    I have plenty of experience working in LabVIEW and with TDMS however very little in using it in other software. I have downloaded the example code on this end but since I don't have your software installed on my machine, there is not a ton I can do in walking you through it. However, I understand this is a very helpful newsgroup for that environment.
    Since you said you modified the header, to make sure everything is in line prior to entering other program, this is a good resource on the TDMS file structure.
    Logan H
    National Instruments
    Applications Engineer

  • Writing Windows system files

    Hi guys!
    I need to edit "boot.ini" file which is a Windows system file.
    When I try to open a BufferedWriter :
    File bootIni = new File("C:/boot.ini");
    BufferedWriter writer = new BufferedWriter(new FileWriter(bootIni))It throws a
    java.io.FileNotFoundException: C:\boot.ini (Access is denied)I tried
    bootIni.setWritable(true)too but that didn't change anything.
    Can somebody show me a solution?
    Thanks
    R0mai

    >
    jschell wrote:
    R0mai wrote:
    It throws a
    java.io.FileNotFoundException: C:\boot.ini (Access is denied)
    Did you have it open in another editor when you did that?No I didn't.
    I found what caused this problem though :
    If "Hidden" is ticked on in the file's properties, then for some reason Java doesn't let me write it.
    I can't find a method which sets the file (un)hidden.
    Edited by: R0mai on Dec 23, 2008 5:52 AM

  • Problem on reading and writing from from a *.txt file

    I get Problem on reading and writing from from a *.txt file. The following is the read() method...
    The software said the DataInputStream is depreciated. Can anyone help me please?
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        String str = "";
        try
          in = new BufferedReader(file);
          //in = new FileInputStream(file);
          for(;;)
            str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);
      }

    Thank you for your reply. I have made some change. However, there is an incompetable type found error.
    in = new BufferedReader(new InputStreamReader(in));The following are all of the code.
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        //BufferedReader in = null;
        String str = "";
        try
          in = new BufferedReader(new InputStreamReader(in));
          //in = new FileInputStream(file);
          for(;;)
            BufferedReader Bstr = new BufferedReader(new InputStreamReader(in));
            //str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);

  • Error while writing the data into the file . can u please help in this.

    The following error i am getting while writing the data into the file.
    <bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
    <part name="code">
    <code>null</code>
    </part>
    <part name="summary">
    <summary>file:/C:/oracle/OraBPELPM_1/integration/orabpel/domains/default/tmp/
    .bpel_MainDispatchProcess_1.0.jar/IntermediateOutputFile.wsdl
    [ Write_ptt::Write(Root-Element) ] - WSIF JCA Execute of operation
    'Write' failed due to: Error in opening
    file for writing. Cannot open file:
    C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
    BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing. ;
    nested exception is: ORABPEL-11058 Error in opening file for writing.
    Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\
    BPEL_Import_with_Dynamic_Transformation
    \WORKDIRS\SampleImportProcess1\input for writing. Please ensure 1.
    Specified output Dir has write permission 2.
    Output filename has not exceeded the max chararters allowed by the
    OS and 3. Local File System has enough space
    .</summary>
    </part>
    <part name="detail">
    <detail>null</detail>
    </part>
    </bindingFault>

    Hi there,
    Have you verified the suggestions in the error message?
    Cannot open file: C:\oracle\OraBPELPM_1\integration\jdev\jdev\mywork\BPEL_Import_with_Dynamic_Transformation\WORKDIRS\SampleImportProcess1\input for writing.
    Please ensure
    1. Specified output Dir has write permission
    2. Output filename has not exceeded the max chararters allowed by the OS and
    3. Local File System has enough space
    I am also curious why you are writing to a directory with the name "..\SampleImportProcess1\input" ?

  • JDBC on Oracle 8.1.5 on Digital Unix System

    In my Digital Unix system , Oracle is loaded on a file system different from the user file system . The necessary zip files are in a directory within the Oracle home directory .
    When I do an import oracle.jdbc.driver.*;
    from a program in my user file system
    it says not found .Other programs not using jdbc however run without any problem from my default directory .
    Does one need to define a classpath in one's '.profile' pointing to the dirctory where the zip files are located . I have done that already . The problem persists .
    What else needs to be done ?
    Does digital unix system read zip files ? or are tar files required ?
    null

    Currently, Designer 6.0 is certified against Oracle 8.1.6 if you install Designer patch set 4.

  • Reading and writing to and from a file to a form

    Hi there
    I would like somebody to send me a code example,
    showing me how to reading records from a file to a form,
    and writing records to the same file from the same form.
    I know that I have to use sycronize, but I just have not been
    successful. I can constract forms, go from form to a form,
    do buttons, do text fields. I can even read and write from and
    to files. However I cannot do is write from a file to a form and
    from a form to a file.
    could somebody please explain how this done, and could you
    please give me a code example. All the books seem to either
    deal with forms or with files. None seem to combine both.
    I am sure it is very ease to do if ONLY I knew how!!!
    thank you very much in advance for you help.

    I understand that code and I have used it before, however thanks for
    trying to help me, it is really appreciated. However, that is not my
    problem. I can read and write from a file to the console and vice versa.
    what I cannot do, no matter how hard I try, is to write from a file, and
    output it in.
    I will tell you how far I have got.
    I have a MenuFrame class, this is the code for it:
    package WorkflowApp;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class MenuFrame extends JFrame {
    JMenuBar menuBar1 = new JMenuBar();
    JMenu menuFile = new JMenu();
    JMenuItem menuFileExit = new JMenuItem();
    JMenu menuHelp = new JMenu();
    JMenuItem menuHelpAbout = new JMenuItem();
    JToolBar toolBar = new JToolBar();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JButton jButton3 = new JButton();
    ImageIcon image1;
    ImageIcon image2;
    ImageIcon image3;
    JLabel statusBar = new JLabel();
    Button button2 = new Button();
    Button button3 = new Button();
    Button button4 = new Button();
    Button button5 = new Button();
    Button button6 = new Button();
    Button button7 = new Button();
    Button button1 = new Button();
    //Construct the frame
    public MenuFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    image1 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("openFile.gif"));
    image2 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("closeFile.gif"));
    image3 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("help.gif"));
    this.getContentPane().setLayout(null);
    this.setSize(new Dimension(400, 492));
    this.setTitle("MenuFrame");
    statusBar.setText(" ");
    statusBar.setBounds(new Rectangle(0, 0, 3, 17));
    menuFile.setText("File");
    menuFileExit.setText("Exit");
    menuFileExit.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    fileExit_actionPerformed(e);
    menuHelp.setText("Help");
    menuHelpAbout.setText("About");
    menuHelpAbout.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    helpAbout_actionPerformed(e);
    jButton1.setIcon(image1);
    jButton1.setToolTipText("Open File");
    jButton2.setIcon(image2);
    jButton2.setToolTipText("Close File");
    jButton3.setIcon(image3);
    jButton3.setToolTipText("Help");
    toolBar.setBorder(null);
    toolBar.setBounds(new Rectangle(2, 2, 389, 30));
    button2.setBounds(new Rectangle(217, 62, 135, 44));
    button2.setLabel("Staff Details");
    button2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button2_actionPerformed(e);
    button3.setBounds(new Rectangle(26, 127, 135, 44));
    button3.setLabel("Arange Viewing");
    button3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button3_actionPerformed(e);
    button4.setBounds(new Rectangle(218, 127, 136, 41));
    button4.setLabel("Valuation");
    button4.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button4_actionPerformed(e);
    button5.setBounds(new Rectangle(28, 196, 135, 41));
    button5.setLabel("Schedule");
    button6.setBounds(new Rectangle(221, 194, 133, 40));
    button6.setName("button6");
    button6.setLabel("Register Interest");
    button7.setBounds(new Rectangle(31, 266, 133, 42));
    button7.setLabel("Register Offers");
    button1.setBounds(new Rectangle(27, 62, 131, 42));
    button1.setLabel("New Client");
    button1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button1_actionPerformed(e);
    menuFile.add(menuFileExit);
    menuHelp.add(menuHelpAbout);
    menuBar1.add(menuFile);
    menuBar1.add(menuHelp);
    this.setJMenuBar(menuBar1);
    this.getContentPane().add(statusBar, null);
    this.getContentPane().add(toolBar, null);
    toolBar.add(jButton1);
    toolBar.add(jButton2, null);
    toolBar.add(jButton3, null);
    this.getContentPane().add(button3, null);
    this.getContentPane().add(button5, null);
    this.getContentPane().add(button7, null);
    this.getContentPane().add(button2, null);
    this.getContentPane().add(button4, null);
    this.getContentPane().add(button6, null);
    this.getContentPane().add(button1, null);
    //File | Exit action performed
    public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    //Help | About action performed
    public void helpAbout_actionPerformed(ActionEvent e) {
    MenuFrame_AboutBox dlg = new MenuFrame_AboutBox(this);
    Dimension dlgSize = dlg.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setModal(true);
    dlg.show();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    fileExit_actionPerformed(null);
    void button2_actionPerformed(ActionEvent e) {
    StaffDetails myFrame = new StaffDetails();
    myFrame.show();
    void button3_actionPerformed(ActionEvent e) {
    ArrangeViewing myFrame = new ArrangeViewing();
    myFrame.show();
    void button1_actionPerformed(ActionEvent e) {
    NewClientFrame myFrame = new NewClientFrame();
    myFrame.show();
    // System.exit(1);
    void button4_actionPerformed(ActionEvent e) {
    Valuation myFrame = new Valuation();
    myFrame.show();
    then I have a new form class, this is the code for it
    package WorkflowApp;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class NewClientFrame extends JFrame {
    Label label1 = new Label();
    Label label2 = new Label();
    Label label3 = new Label();
    Label label4 = new Label();
    Label label5 = new Label();
    Label label6 = new Label();
    Label label7 = new Label();
    Label label8 = new Label();
    Label label9 = new Label();
    Label label10 = new Label();
    TextField textField1 = new TextField();
    TextField textField2 = new TextField();
    TextField textField3 = new TextField();
    TextField textField4 = new TextField();
    TextField textField5 = new TextField();
    TextField textField6 = new TextField();
    TextField textField7 = new TextField();
    TextField textField8 = new TextField();
    TextField textField9 = new TextField();
    TextField textField10 = new TextField();
    Button button1 = new Button();
    Button button2 = new Button();
    //Construct the frame
    public NewClientFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    this.getContentPane().setLayout(null);
    this.setSize(new Dimension(411, 488));
    this.setTitle("NewClientFrame ");
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    this_windowClosing(e);
    label1.setBounds(new Rectangle(21, 23, 110, 23));
    label1.setAlignment(2);
    label1.setText("Assign Number");
    label2.setBounds(new Rectangle(23, 57, 108, 25));
    label2.setAlignment(2);
    label2.setText("Name");
    label3.setBounds(new Rectangle(40, 91, 94, 24));
    label3.setAlignment(2);
    label3.setText("Address 1");
    label4.setBounds(new Rectangle(21, 124, 112, 29));
    label4.setAlignment(2);
    label4.setText("Address 2");
    label5.setBounds(new Rectangle(20, 159, 116, 29));
    label5.setAlignment(2);
    label5.setText("PoscCode");
    label6.setBounds(new Rectangle(18, 197, 119, 26));
    label6.setAlignment(2);
    label6.setText("Telephone");
    label7.setBounds(new Rectangle(25, 228, 112, 26));
    label7.setAlignment(2);
    label7.setText("Other Telephone");
    label8.setBounds(new Rectangle(12, 261, 125, 24));
    label8.setAlignment(2);
    label8.setText("Email Address");
    label9.setBounds(new Rectangle(6, 301, 138, 25));
    label9.setAlignment(2);
    label9.setText("Staff Assigned (Name)");
    label10.setBounds(new Rectangle(22, 341, 124, 23));
    label10.setAlignment(2);
    label10.setText("Staff Assigned (No.)");
    textField1.setBounds(new Rectangle(155, 19, 80, 26));
    textField2.setBounds(new Rectangle(155, 58, 193, 24));
    textField3.setBounds(new Rectangle(156, 90, 192, 25));
    textField4.setBounds(new Rectangle(157, 126, 192, 23));
    textField5.setBounds(new Rectangle(157, 159, 195, 25));
    textField6.setBounds(new Rectangle(157, 194, 195, 26));
    textField7.setBounds(new Rectangle(157, 230, 192, 24));
    textField8.setBounds(new Rectangle(157, 263, 193, 25));
    textField9.setBounds(new Rectangle(157, 303, 196, 24));
    textField10.setBounds(new Rectangle(158, 337, 95, 24));
    button1.setBounds(new Rectangle(23, 398, 144, 34));
    button1.setLabel("Staff Available");
    button2.setBounds(new Rectangle(211, 396, 148, 34));
    button2.setLabel("Submit Record");
    button2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button2_actionPerformed(e);
    this.getContentPane().add(label1, null);
    this.getContentPane().add(label2, null);
    this.getContentPane().add(label3, null);
    this.getContentPane().add(label4, null);
    this.getContentPane().add(label5, null);
    this.getContentPane().add(label6, null);
    this.getContentPane().add(label7, null);
    this.getContentPane().add(label8, null);
    this.getContentPane().add(label9, null);
    this.getContentPane().add(label10, null);
    this.getContentPane().add(textField1, null);
    this.getContentPane().add(textField2, null);
    this.getContentPane().add(textField3, null);
    this.getContentPane().add(textField4, null);
    this.getContentPane().add(textField5, null);
    this.getContentPane().add(textField6, null);
    this.getContentPane().add(textField7, null);
    this.getContentPane().add(textField8, null);
    this.getContentPane().add(textField9, null);
    this.getContentPane().add(textField10, null);
    this.getContentPane().add(button1, null);
    this.getContentPane().add(button2, null);
    public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    // exit(this);
    // close();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void button2_actionPerformed(ActionEvent e) {
    // myFrame.close();
    this.dispose();
    void this_windowClosing(WindowEvent e) {
    this.dispose();
    I also have an about box, staff details, and valuation forms.
    what I am trying to do is for the New client form to be able to read and write from and to a file, and display the info.
    I am working in JBuilder3, a bit out of date I know, but it is the best I can do. Any Ideas how to do this.

  • Word Docs have become Unix Executable Files!

    The subject says it. This has happened on both my wife's iMac G5, and my MacBook Pro. Some, not all, of our Word docs, (both using 2004, running OS X.4.7) have had their icons turned into a gray console, and in "Get Info" identify themselves as "Unix Executable File." When opened in Word, I get the option to open as if it were a foreign file, and typically, it opens with all formatting gone, and all kinds of bizarre characters at the beginning (and sometimes end) of the doc.
    Now, I can salvage the data, it seems, but is there some way to simply undo this damage without manually going through every file?
    I must say, this is exactly the kind of junk that I would expect to find on a PC. This is a stunningly bad problem, by far the worst I've experienced in almost 15 years of using Macs. I would assume that Apple is aware of this, and that they can:
    1) Explain what happened.
    2) Explain a quick and easy fix.
    Thanks to anyone (from Apple or otherwise) who can do 1 and 2 above.

    Jeffois,
    The first command I gave to you will render the directory in question, and all nested directories, inaccessible. The second command will make the diretories accessible again.
    There is a possibility that there are files in this directory structure which are not owned by you. Not likely, but I must make the assumption that these could be encountered when I give such commands "in the dark" as it were. In such a case, you would see an error regarding these files, thus the warning.
    You can return your directories to accessibility using the second command, regardless of errors you might encounter. If you do encounter errors, I will post a different form of the same commands that will work.
    Be prepared to deal with this problem any time you transfer files from a Windows-formatted volume. This is not a Windows problem, but rather one of differences between the two file systems. If you see a file show up with the executable icon, you might want to remove the execute bit right away. Unfortunately, there is no way to do this in the GUI, so you must resort to using Terminal.
    This shouldn't be too much of a problem. Just open Terminal, type this text with a traling space:
    <pre style="overflow:auto; font-family: 'Monaco'; font-size: 10px">chmod a-x</pre>
    then select all of the new files and drag them all into the Terminal window. This will create a rather long command line that includes the full path to every file you dragged in. Just press <RETURN>, and "POOF," no more execute bit!
    Scott

  • ABAP to FTP connect to non SAP UNIX system

    Greetings~
    I'm looking for a way (via function modules and/or BAPI) to transfer data in flat files from an SAP UNIX system to a non-SAP UNIX system using an ABAP program. I see FM's FTP_CONNECT and FTP_COMMAND however these seem to only work with UNIX systems running SAP as they require RFC_DESTINATION information. Anybody know which (if any) FM's can be used without the necessity of the target system running SAP/RFC?
    Thanks!

    Hi Joseph,
    Please refer the below program.
    REPORT  ZHR_T777A_FEED.
    tables: t777a.                        "Building Addresses
    Internal Table for  Building table.
    data: begin of it_t777a occurs 0,
            build like t777a-build,       "Building
            stext like t777a-stext,       "Object Name
            cname like t777a-cname,       "Address Supplement (c/o)
            ort01 like t777a-ort01,       "City
            pstlz like t777a-pstlz,       "Postal Code
            regio like t777a-regio,       "Region (State, Province, County)
          end of it_t777a.
    Internal Table for taking all fields of the above table in one line
    separated by ‘|’(pipe).
    data: begin of it_text occurs 0,
          text(131),
          end of it_text.
    Constants: c_key  type i value 26101957,
               c_dest   type rfcdes-rfcdest value 'SAPFTPA'.
    data: g_dhdl type i,      "Handle
          g_dlen type i,      "pass word length
          g_dpwd(30).         "For storing password
    Selection Screen Starts
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE TEXT-001.
    parameters: p_user(30) default 'XXXXXXX'          obligatory,
                p_pwd(30)  default 'XXXXXXX'          obligatory,
                p_host(64) default 'XXX.XXX.XX.XXX'   obligatory.
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN BEGIN OF BLOCK blk2 WITH FRAME TITLE TEXT-002.
    parameters: p_file like rlgrap-filename default 't777a_feed.txt'.
    SELECTION-SCREEN END OF BLOCK blk2.
    Password not visible.
    at Selection-screen output.
      loop at screen.
        if screen-name = 'P_PWD'.
          screen-invisible = '1'.
          modify screen.
        endif.
      endloop.
    g_dpwd  = p_pwd.
    Start of selection
    start-of-selection.
    To fetch the data records from the table T777A.
      select build stext cname ort01 pstlz regio
             from t777a
             into table it_t777a.
    Sort the internal table by build.
      if not it_t777a[] is initial.
        sort it_t777a by build.
      endif.
    Concatenate all the fields of above internal table records in one line
    separated by ‘|’(pipe).
      loop at it_t777a.
        concatenate it_t777a-build it_t777a-stext it_t777a-cname
                    it_t777a-ort01 it_t777a-pstlz it_t777a-regio
                    into it_text-text separated by '|'.
        append it_text.
        clear it_text.
      endloop.
    To get the length of the password.
      g_dlen = strlen( g_dpwd ).
    Below Function module is used to Encrypt the Password.
      CALL FUNCTION 'HTTP_SCRAMBLE'
        EXPORTING
          SOURCE      = g_dpwd          "Actual password
          SOURCELEN   = g_dlen
          KEY         = c_key
        IMPORTING
          DESTINATION = g_dpwd.         "Encyrpted Password
    *Connects to the FTP Server as specified by user.
      Call function 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'Connecting to FTP Server'.
    Below function module is used to connect the FTP Server.
    It Accepts only Encrypted Passwords.
    This Function module will provide a handle to perform different
    operations on the FTP Server via FTP Commands.
      call function 'FTP_CONNECT'
        EXPORTING
          user            = p_user
          password        = g_dpwd
          host            = p_host
          rfc_destination = c_dest
        IMPORTING
          handle          = g_dhdl
         EXCEPTIONS
            NOT_CONNECTED.
      if sy-subrc ne 0.
        format color col_negative.
        write:/ 'Error in Connection'.
      else.
        write:/ 'FTP Connection is opened '.
      endif.
    **Transferring the data from internal table to FTP Server.
      CALL FUNCTION 'FTP_R3_TO_SERVER'
        EXPORTING
          HANDLE         = g_dhdl
          FNAME          = p_file
          CHARACTER_MODE = 'X'
        TABLES
          TEXT           = it_text
        EXCEPTIONS
          TCPIP_ERROR    = 1
          COMMAND_ERROR  = 2
          DATA_ERROR     = 3
          OTHERS         = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ELSE.
        write:/ 'File has created on FTP Server'.
      ENDIF.
    Call function 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          text = 'File has created on FTP Server'.
    To Disconnect the FTP Server.
      CALL FUNCTION 'FTP_DISCONNECT'
        EXPORTING
          HANDLE = g_dhdl.
    To Disconnect the Destination.
      CALL FUNCTION 'RFC_CONNECTION_CLOSE'
        EXPORTING
          destination = c_dest
        EXCEPTIONS
          others      = 1.
    Regards,
    Kumar Bandanadham.

  • Copy hidden system files from admin to client?

    I'm preparing for a large rollout of Macs and one of our apps hides its license file with a . in front of the file name. Rather than type in the serial number 100 times, I'd like to simply blast out the license file via ARD to same relative location, but of course it's not visible to the OS/ARD. The containing folder is not hidden, it's just a single file that needs to be copied.
    Is there any way to do this, perhaps by Unix cp command? How do you tell the remote computer to source the file from my computer, since the command is run locally on the remote machine. (Whew.)
    Thank you.

    Lots of people are unaware of those extra options in the Finder Search. The other one that's commonly needed but not known about is the option to search system files, which is also under "other". You may want to check the "In Menu" box for those two so that they are available directly from the pulldown menu; they're both needed pretty often for many people.
    Happy to have been of help.
    Cheers.

  • Why did all my files suddenly become UNIX Executable Files?

    After reformatting my hard drive and installing Panther server, I restored the Retrospect back up of files to my home directory. Unfortunately, all the files that didn't have suffixes (eg: .doc, .xls, .pdf, etc.) suddenly had their icons replaced with an icon of a black console with the word "exec" typed in. And their kind was lost and all became: UNIX Executable File.
    Ever since this Panther server has been acting eratically.
    I have been able to resurrect the affected files by opening them in their native application and resaving them with the proper suffix. But there are thousands of files and dozens of applications that could have made each file.
    Is there a way to resurrect these files without having to open and resave every single file in its native application one at a time? Could these thousands of UNIX Executable Files be causing problems for Panther server?
    Thanks for your input.
    Gregg

    Hi TropicalReef,
    At some point during your backup/restore process the executable bit was set on your files. This should not cause a problem with the overall performance of the operating system. But to some extent this is a security risk. There are a number of GUI applications that can change file permission. I recommend you download one and remove the executable bit from your files. Read the developers documentation carefully. Changing file permission especially in batch mode can be very dangerous.
    The easiest way to make you files double clickable is to add the appropriate suffix to the file name. Again there a number of shareware and freeware apps that will do this. Check MacUpdate and VersionTracker.

  • Recovered files now UNIX Executable Files???

    After my previous external hard drive failed I had the data recovered and placed onto a new external drive. After looking at the files I have found that a number of them have become "unix executable files." I don't know what this is or how to fix it. It seems to have only happened to things such as saved emails, but there are some photos from my digital camera that have converted to this as well.
    While looking into the problem I found that the company that recovered the data placed it all onto an external hard drive that is an MS-DOS File System (FAT32) format instead of a Mac OS format. Could this be the problem since all of my files were Mac files, and the hard drive they were recovered from was formatted to Mac OS?
    If this is the case, is it something I can fix myself without loosing anything, or should I take it back to the place that recovered the data?
    ANY help would be greatly appreciated!

    Welcome to Apple Discussions!
    Yes the file naming probably was messed about with when they copied stuff over to FAT32. The files are probably there. However, the just need the correct file suffix to associate with the correct programs. A good way to test the files without hurting them is to view them in the Terminal with the program called More. Go to Applications -> Utilities -> Terminal and you will be greeted by a prompt. At the prompt type the word
    more
    followed by a space (do NOT hit enter)
    and drag the file into the terminal following the word "more" and then when the path appears, hit enter. If there is intelligible text, the file is probably an e-mail. If there is no intelligible text, it probably is an image, or a system file. Preview can open the files which are images and save them to specific formats. Depending on the number of files you had rescued, it might be better to ask them to rescue it again, but to a properly formatted volume. You can try yourself if you still have the old disk with Prosoft Data Rescue.
    In anycase, this is a very good lesson to always backup your data in the future as my FAQ explains:
    http://www.macmaps.com/backup.html
    Good luck!

  • Unix executable file- in backup email files

    Hello,
    I've searched the discussions and found a few posts that resemble my question but nothing exactly/ nothing suggested has worked so far.
    I have entire email files backed up to a LaCie drive- 2 actually. All of the email backup icons have been changed to "Unix executable file"- the icon is a grey box with "exec" on it.
    The promising side is that the files are still large- 301 mgs, etc- so I would think there is still information in the file.
    I've tried going into "Info" and changing "open with" to entourage or thunderbird. Or even Excel to see if I could get a tab delimited file and convert. Nothing has worked so far.
    I've seen this before with other types of backup files as well. I haven't changed operating systems, have only been working on Macs, this has happened both on a wireless ethernet disk and a firewire drive.
    Any suggestions? Thanks!
    jz

    Hi,
    Never fear! Your original MacOS disks should include the developer tools. They call it xcode these days. By default it should install extra command line utilities in /Developer/Tools. So really the command should look like:
    /Developer/Tools/SetFile -t 'TEXT' -c 'CSOm' your_mbox
    You can add /Developer/Tools to your $PATH variable to avoid the extra typing. But you can do that later. Just replace your_mbox with the path to one of your Eudora mail boxes that you've copied back to your harddrive.
    Cole

Maybe you are looking for

  • Did you know that if your phone is stolen, Find my Phone is useless?

    Lessons from my lost iPhone. Despite having a pin to unlock the iPhone, you can simply power off the phone with a long press of the power button. Which means that if your phone is stolen and the thief is smart enough to turn it off (is there one who

  • A solution for Secure Static Versioning problem in 1.5.0_10

    Hi, I have JRE 1.3.1_09 and 1.5.0_10 on my computer and I think I have solved static versioning problem. My test computer: - Windows XP sp2 - Internet Explorer 7 (on another computer also IE 6) - Firefox 2.0.0.1 - JRE 1.3.1_09 - JRE 1.5.0_10 I. Solut

  • JCA Inbound adapter error

    Hi everybody, I have an ESB project which reads a file from a folder and writes it into another folder. The issue is that sometimes it works ok, but some others the in adapter fails and I get this error: JCA inbound adapter service listener for "SUBI

  • Problem with path and compiling

    I am trying to compile a class where I have and object I created as well. It complains that it cannot find that object (or class in the classpath) and fires this error when I try to compile: Error: csci5433.database.animals.Pets.customerName is decla

  • Recovering library from new external hard drive

    My old external hard drive containing my iTunes and iPhoto libraries crashed.  I paid to have the data recovered.  The libraries are now on a new portable hard drive, but I don't know how to access them through ITunes and iPhoto.  Can anyone help?