How to create a file in current directory

hi,
I want to create a file in a current directory, But when i written following
code then it cannot create file, How i will create file in current directory?
Is there anyone who can help me?what will be the solution of this problem?
Please give me solution
String dir=application.getRealPath("/");
     int count;
     String filename="sample.txt";
     out.println(dir+filename);
     FileOutputStream fout=new FileOutputStream(filename);
     PrintStream p;
     p=new PrintStream(fout);
     p.print("1");
     p.close();with regards
Bina

hi,
my problem is that my path is ok...but when i open file in this directory then
it cannot open a file, is there anyone who can do it? When a user save data in server from remote
area then what will be path of my code? how i will solve it? please give me
solution.
with regards
bina

Similar Messages

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • How to create a file in the server?

    Hi,
    I'm making a webservice that has to generate a XML file, sign it using another webservice and return this XML. The problem is that i don't know how to create the file in the server throught webservice.
    I use this code in the webservice to generate the XML and after I return the XML to client in a byte[]
         static void outputDocumentToFile(Document myDocument, String path) {
            //setup this like outputDocument
              try {
                   // XMLOutputter outputter = new XMLOutputter("  ", true);
                   XMLOutputter outputter = new XMLOutputter();
                   //output to a file
                   FileWriter writer = new FileWriter(path);
                   outputter.output(myDocument, writer);
                   writer.close();
              } catch(java.io.IOException e) {
                   e.printStackTrace();
        }But the file is generated in the client-side, how can I generate the file in the server-side?
    Thanks very much.

    Well the File object doesn't create a file it's simply an abstract representation of file and directory pathnames.
    You can try something like this:
    <%
    try
    // get the path to the web server root
    // I read somewhere not to use 'getRealPath' for some reason which I
    // can't seem to remember :S Hopefull someone can enlighten us :)
    String path = application.getRealPath("/project/jsp/demo.txt");
    File file = new File(path);
    PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
    writer.println("Hello World!");
    writer.close();
    catch (Exception e)
    System.err.println(e.getMessage());
    %>
    Hope this helps :)

  • How to create temp files in temp tablespace

    Dear all,
    Due to outage of our SAN, we our out of production for the
    last 3 days. By the grace of Almighty we have restored production by
    database recovery from our standby backup. Since temp tablespace and
    temp data files do not taken as backup for standby, now after recovery
    we are getting abap dumps asking for temp_1 and temp_2 datafiles.
    Please guide us how to create temp files. v$tablespace is showing tablespace PSAPTEMP but datafile are not there
    Abap dumps are giving these errors as mentioned below
    ====================================================
    The exception must either be prevented, caught within the procedure            
    "DATA_SELECTION"                                                              
    "(FORM)", or declared in the procedure's RAISING clause.                       
    To prevent the exception, note the following:                                  
    Database error text........: "ORA-01157: cannot identify/lock data file 256 -  
    see DBWR trace file#ORA-01110: data file 256:                                 
    '/oracle/SD1/sapdata4/temp_2/temp.data2'"                                     
    Internal call code.........: "[RSQL/FTCH/MARA ]"                               
    ===================================================
    another one asking for 
    '/oracle/SD1/sapdata3/temp_1/temp.data1'"
    Best Regards
    Waqas

    if you want to add a new tempfile to your TEMP Tablespace,you can do like that.
    <i>ALTER TABLESPACE</i> <<b><u>name of TEMP Tablespace</u></b>> ADD TEMPFILE <<b><u><b><u>pfad to the file_and_file name</u></b></u></b>> <b>SIZE</b> <size>;
    You can use also the options <i>REUS</i>E <i>autoextend off</i> or <i>on</i> .
    e.g:
    <i>alter tablespace</i> <u><b>PSAPTEMP</b></u> add <i>tempfile</i> <b><u>'/oracle/SD1/sapdata4/temp_2/temp.data2'</u></b> <i>SIZE 1000K</i> <i>REUSE</i>;
    The directory <b><u>temp_2</u></b> should exist.
    Or you can use the BR*Tools to create a new datafile. Enter brtools and follow the instructions or menu.
    More to TEMP Tablespaces see please following SAP notes:
    <u><b>659946</b></u> - FAQ: Temporary tablespaces
    <u><b>600513</b></u> - ORA-25153 after recovery due to missing tempfiles
    and the Oracle Note:
    <u><b>160426.1</b></u>: TEMPORARY Tablespaces : Tempfiles or Datafiles ?
    I hope it helps.

  • Anyone knows how to delete a file from a directory?????

    hi there
    anyone has any idea on how to delete a file from a directory? delete(String filename)? thank you.

    Hi,
    Check this link.
    Gives you an example code to show how to delete a file.
    http://examples.oreilly.com/jenut/Delete.java
    Hope this helps.
    Roopasri Vittal
    Developer Technical Support
    Sun Microsystems
    http://sun.com/developers/support

  • I am working in windows 7 and I am trying to enable the copy/paste and I can not find user.j file in the profile and I am not real sure how to create a file, I can create a folder .

    I am trying to copy text from a word document and paste it into my web builder and it says that firefox does not support copy/paste from clipboard. Went to your site and it tells me to open the user.j file in my profile. This file does not exist and I am not real sure how to create that file so I can paste the fix from your site into it.

    I went to that link and added to firefox add on but it still does not work. I went to the add on option button for this but it told me that my MYSIWG widget was disabled. Does this have something to do with it not working and if so how do you enable it.

  • How to create txt file in utf-8?

    Hi,
    if i create a txt file using vb in fdm, it is created with the ansi encoding. Is there any option how to create this file in utf-8?
    Thx

    Forms6i uses Oracle 8.0.6 client libraries. MetaLink Note 207303.1 lists supported client/server configurations, and the last database version supported with those libraries is Oracle 9.2. The only exception is made for e-Business Suite (Oracle Applications). Therefore, you configuration is not supported.
    Anyway, Oracle 8.0.6 does not support AL32UTF8 well. You should select UTF8 as the database character set (not national character set!). You need to select a check box on DBCA interface (possibly unavailable in fast/default installation path) which allows you to see non-recommended character sets.
    -- Sergiusz

  • How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!

    How to create backup file on itunes for ipod touch 4g game apps data? Is there a way to do it? I want to try an app on my friend's computer, but you can't add apps on another computer without having your own ipod's data being deleted. Thx for any help!
    I want to know how to create a backup file (because I'm pretty new with itunes, and it's hard to use it for me still), how to store my app data/media/videos, etc. And how I can retrieve them back when I'm done with the app I tried on my friend's computer.
    If anyone can help, it'd be great! Thank you so much!

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • How to create xml file from Oracle and sending the same xml file to an url

    How to create xml file from Oracle and sending the same xml file to an url

    SQL/XML (XMLElement, XMLForest, XMLAgg, etc) and UTL_HTTP.
    Whether that works for you with the version of Oracle you have, your requirements, and needs is another story. A little detail goes a long way.

  • Installer does not create directories/files in APPDATA directory

    I have an installer that installs the application into the Program Files directory, and additionally, is supposed to create application files and a directory structure in the Public App Data (%APPDATA%) directory of the Windows installation. In the LV Build Specification, I have created the appropriate destinations, moved the project specific files to those destinations in the Source File section, and tried combinations of the source file properties. When I run the installer, the application installs into Program Files correctly, however, nothing is created in %APPDATA%. I have even marked these files as vital to the installation, in order to stop, if there's a problem. No problem was indicated during the installation.
    Thanks for the help.

    Hi Jlgeris,
    I build a little istaller and told the installer to put something in the appdata directory as you can see in the attached files. After  installing it, I found the file in the right directory.
    Did you do this in the same way?
    regards
    Tobias
    Attachments:
    Destinations.png ‏89 KB
    Source_Files.png ‏93 KB
    Appdata.png ‏95 KB

  • How to create IDX files

    Hi All,
    How to create IDX files, In pdf i have done full text index with catlog, i have got the pdx files.
    But i need the index files *.idx files.
    How to get these files.
    Please help me to solve this issue.
    Regards,
    Vinoth

    i have created the button on Acrobat X professional.
    Please find the below code for search the text
    // Test search text and only proceed if it’s not empty
    var cSearchTxt = this.getField("SearchText").value;
    if(!/^\s*$/.test(cSearchTxt))
       // Create first part of path to index file from this file
       var aPath = this.path.split("/");
       aPath.pop();
       var cPathRoot = aPath.join("/");
       // Determine Index to use with search
       var cIdxPath = "";
       var cCatagory = this.getField("Catagory").value;
       switch(cCatagory)
          case "P01":
             cIdxPath = cPathRoot + "/Catalogs/Paper01.pdx";
             break;
          case "P02":
             cIdxPath = cPathRoot + "/Catalogs/Paper02.pdx";
             break;
       // Setup Search Options
       //search.matchCase = this.getField("CaseSensitive").isBoxChecked(0);
       //search.matchWholeWord = this.getField("WholeWord").isBoxChecked(0);
       //search.wordMatching = this.getField("MatchOpts").value;
       //  Perform Search
       search.query(cSearchTxt, "Index", cIdxPath);
    Regards,
    Vinoth

  • How to duplicate a file in a directory to another directory?

    I am a student just has just learn some basic Java programming...May i know how to duplicate a file in a directory to another directory?
    How to start in doing this?
    Thank You

    I was suggesting to use java to send commands to the system shell so to speak....
    I don't know of a way to do this... under the File class you can delete files, but there is no provision to copy Files so to speak....
    one way would to be to open the file you want to copy with a file reader, and then write it all out to your new file.
    see http://java.sun.com/j2se/1.3/docs/api/java/io/FileReader.html for information of FileReaders

  • How to create xpi file for my own extension?

    I have created my own extension and directly added profile extension folder in my system.its working fine. but while installing extension using .xpi file its produce error "Install script not found
    -204".Please explian me how to create .xpi file for my extension folder.
    I hope you can help this issues.
    Thanks in advance.
    Regards
    vasanthi

    See this:
    https://developer.mozilla.org/en/Building_an_Extension

  • How to create Batch file to execute sql scripts

    Hi friends,  
          i want to create batch file to execute all my .sql scripts.
    I have all table ( all table scripts in single file ) ,Udds ( all udds in single file ) ,Stored procedures( separate file for each SPs ),Functions ( Separate file for each Functions ),Triggers and views scripts in .SQL file.   
    can anybody tell me how to create batch file for executing all these scripts in sql server ?.   
       while executing, it should ask Database name,server name, password. if these details are given then it should execute my all scripts in given database
    , if any error thrown then that error and procedure name alone have to move to separate log file..
    Please help me if this possible or any other easy way to do this..
    Thanks - Ravi

    Hi  Mate.
    can i save the below details in my batch file parmantly, so that i don't need to provide the details agains again in CMD while i execute this. Please help
    set /p SName=Server Name :
    set /p UName=User Name :
    set /p Pwd=Password :
    set /p DbName=Database Name
    If  i am providing the details before execution of this bat file it will throw error.

  • How to create a file under web application root from java program

    how to create a file under web application root from java program like an action class?

    like an action class?Huh? What exactly is your requirement?
    Creating a file is usually done with java.io API. Read the java.io tutorials how to play with files.

Maybe you are looking for

  • Four-finger swipe constantly stops working

    I'm running Snow Leopard on my 27" iMac with a Magic Trackpad, and the four-finger swipe Expose gesture regularly stops working, which two and three-finger gestures continue to work fine.  Sometimes a reboot will fix the problem, other times I can re

  • Syncing iPod with iTunes using Windows Vista

    I bought my iPod last December and had an Hp Laptop using Windows Xp. Recently I bought a new computer that has Windows Vista on it and since then I can't sync my iPod. iTunes won't recognise that it's even connected. I have transfered all my music a

  • Function Module performance in Crystal Reports - Best practices

    Hi all, We are following a function module based approach for our crystal reporting needs. We tried to follow an infoset approach, but found that most of the critical fields required for reports were retrieved from function modules and bapis. Our rep

  • ITunes 9: a lament for the shopping basket

    Much as I love the concept of a wish list, my shopping basket WAS my wish list before. I don't like one-click buying, so I turned that off and added stuff to my shopping basket as I went. Now the option to use a basket has been removed from iTunes. S

  • Adobe Reader crashing on MacOS X 10.8.3 (Intel)

    Adobe Reader crashes after a few seconds when I open a PDF file. I've tried a number of files and also removed and re-installed the App. Is this a known issue? Edit: Still getting the same error. Reader crashes a few seconds - a minute after opening