Can I clear the file?

can I clear a file as clear a buffer or memory?
I designed a subclass extends File,I want to add some method such as copyTo(),read(),clearFile().....
but I do not know how to clear the file.
set the length of a file to 0 make sense?and there are not a method setLength in class File. which can be found in RandomAccessFile.
or I read the File into FileInputStream and skip all and then write it to an OutputStream?
I am newbird,thanx all help me!

Hi
I think this may solve your problem.
try
               File f = new File("input.txt");
               FileOutputStream fo = new FileOutputStream(f);
               fo.write(0);/Writes 0 byte into the mentioned file.
          catch(FileNotFoundException fnf){
               fnf.printStackTrace();
          catch(IOException ioe){
               ioe.printStackTrace();
-Kavitha

Similar Messages

  • I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?

    I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?  I don't know why the photos are still taking up space and if I will have to reset my phone to get rid of the problem.

    Hey there TowneJ,
    Welcome to Apple Support Communities.
    The article linked below provides troubleshooting tips that’ll likely resolve the issue that you’ve described, where deleted files appear to be taking up space on your iPhone 5.
    If you get a "Not enough free space" alert on your iPhone, iPad, or iPod touch - Apple Support
    So long,
    -Jason

  • Can't clear a file that keeps on dowloading from the download manager

    I clicked a link (linking to a .jpeg) in an e-mail for something I purchased thinking it was an extra to the purchase, but afterwards I realised it was just an Image to accompany the e-mail.
    The problem is I can't clear the download from the download manager and everytime Firefox starts it makes a connection to download the file. I tried clicking the "x" next to the download but this just paused the download. I have also tried clicking "Clear Downloads" in the download Library but this didn't help.
    How can I remove this file from the download manager ?
    Thank you

    Hey philipp, thanks for your answer! I wasn't aware it was a bug with the beta. I voted for it to be fixed.
    Thanks!

  • "Can't Save the File. Can't Print the File" error in Illustrato CS3

    I get the error "CAN'T SAVE THE FILE. CAN'T PRINT THE FILE". In Illustrator CS3
    According to adobe this is an issue of having more that 28 spot colors, so I went to the swatch palette and pulled the fly-out menu out and told it to remove any unused swatches which took me down to 6 spot colors, but I still get the error when trying to save it to EPS format, which is the format I have to have for the ripping program for the vinyl printer in my sign shop. Saving it in AI format causes no issues.
    Is there still something I am missing?
    Thanks
    Roger

    I appreciate your comment, I see what your saying.
    However...my issue is...I am making a vehicle wrap on a full size van for a radio station and it consist of pictures of a clouds for the background with two pictures of music artist that are associated with the kind of music this station plays, then there is a big round logo of the radio station that involves three spot colors (Purple, white and one of which is technically the black "K" ribbon) along with the web address of the station but it is of the same colors of the radio station logo...then there is the corporate logo that utilizes another spot color (blue)so as you can see I need the spot colors that I'm using.
    So just to make sure I'm clear...I can only have 28 different individual colors, even though I have photos involved in the rendering? How can I make that work because photos obviously have more than 28 colors in them. It doesn't make sense because you can do a live trace on something in literally hundreds of colors.
    Would it help if I flattened the photo work from photoshop before I move it to Illustrator? The reason I ask is because when I go to save and choose EPS the next save dialogue that comes up...down at the bottom there is two exclamations that one says something about embedding fonts, which I'm not concerned about and the other is something about there is some artwork that needs flattening.
    Please bear with me here cause I am definitely a newbie!! My boss threw to the wolves on this adventure and I am learning by reading and trial and error.
    Thanks
    Roger

  • HT201301 i can't find the file sharing section? why is that?

    i can't find the file sharing section? why is that? it's not shown on my iTunes. . .

    Please explain more clearly what problem you are having.

  • Firefox can't find the file error when trying to download

    I am currently not having luck when clicking on the download button for each app...This is the error message I get,
    Firefox can't find the file at aam://SAPCode=AEFT?productVersion=12.0?passPhrase=Qx6qMfb9/oWx8agnabYz/ksL9vygzb30ZVZ6+4A KgbiDkQIEh1TTurmjLJXYoGHBdt97o64hQwef/EPa7zXT42z8iGzC7ZzUJWaBk1IID76maBwP1cEMXK0VB+DYo98sF gay7207mzeSwQIwGrMPLC+Ep78B13gEXvFdrr7Tg2I=.
    I'm running ML 10.8.4 on 2010 Macbook Pro.
    Thanks for any and all help.

    clear your adobe.com cookies and retry.

  • How can I clear the recent document list on the welcome page?

    Have some confidential docs that I don't want to appear when the program is launched. How can I clear the recent document list on the welcome page and the "open recent" list?  thx

    It's not an option in the prefs. It's a hidden file that makes up part of the preference set (as far as I know, most, or all of the seetings you can adjust inside ID's prefences dialog are actually saved in the other half of the set, InDesign Defaults). For more information, see Replace Your Preferences

  • How can I clear the parallel port?

    I'm sending image-files to a custom made printing unit via VISA through the parallel port.
    Sometimes the unit doesn't accept the file.
    Therefore I need to clear the parrallel port completely and send the file again.
    (Right now I'm switching off the unit and waiting for the error message from WindowsNT).
    How can I clear the parrallel port via LabVIEW?
    (VISA clear.vi doesn't work, the data is still on the port).

    Rainer,
    Maybe you can try the "VISA Flush I/O Buffer" vi (VISA - VISA Advanced -
    Interface Specific). It worked on a serial port, but I have no idea if it
    works
    also on a parallel port. It is worth trying it.
    Good Luck.
    "rainer" schreef in bericht
    news:[email protected]..
    > I'm sending image-files to a custom made printing unit via VISA
    > through the parallel port.
    > Sometimes the unit doesn't accept the file.
    > Therefore I need to clear the parrallel port completely and send the
    > file again.
    > (Right now I'm switching off the unit and waiting for the error
    > message from WindowsNT).
    > How can I clear the parrallel port via LabVIEW?
    > (VISA clear.vi doesn't work, the data is still on the port).

  • HT1461 For Boot Camp, if you save a file when you are on the Windows side, when you return to the Mac side, can you see the file or can it only be "seen" on the operating side you create it in?

    For Boot Camp, if you save a file when you are on the Windows side, when you return to the Mac side, can you see the file or can it only be "seen" on the operating side you create it in?

    Why don't you  (generic most every post lacks critical details) be clear and say you never used Mac OS etc.
    But, I did try to anticipate and give you what you needed.
    Excel is one of those rare programs that, if they are extremely large complex spreadsheets still tend to run better under Office for Windows.
    A VM won't do for that but it does make it easier to transition. As in: install Windows natively, then use VMware Fusion or Parallels to attach to the partition and OS. That way you can run Windows as Guest OS VM under Mac; and still run Windows natively dual-boot when needed.
    The word "see" was not what you wanted, was it? really? you want to open and make changes and keep it on Windows side rather than Save As or copy to Mac
    You use Windows and don't know it has NTFS (NT FileSystem)?
    http://en.wikipedia.org/wiki/NTFS
    http://en.wikipedia.org/wiki/Hierarchical_File_System (HFS) native file system used by Apple
    And there is much more UEFI style "bios" and other things I suppose.
    Great thing about Google and encyclopedias or dictionary, you can look up what you don't know.

  • I can not open the file in Photoshop...

    I can not open the file in Photoshop after formattatto pc.
    I get the following error "could not complete your request because there is an error in the program
    Please me!
    Thank you

    Version CS3
    Adobe DNG Converter and Camera Raw 4.6 update
    6.2MB
    10/10/2008
    Camera Raw 4.6 update
    3.5MB
    10/10/2008
    Camera Raw 4.5 update
    3.5MB
    7/28/2008
    Adobe DNG Converter and Camera Raw 4.5 update
    6.1MB
    7/28/2008
    Adobe DNG Converter and Camera Raw 4.4.1 update
    5.4MB
    4/10/2008
    Camera Raw 4.4.1 update
    3.3MB
    4/10/2008
    Camera Raw 4.3.1 update
    3.3MB
    11/15/2007
    Adobe Photoshop 10.0.1 update for Adobe Photoshop CS3
    72.8MB
    11/15/2007
    Adobe DNG Converter and Camera Raw 4.3.1 update
    6.1MB
    11/15/2007
    Adobe DNG Converter and Camera Raw 4.2 update
    5.9MB
    9/13/2007
    Camera Raw 4.2 update
    3.2MB
    9/13/2007
    Camera Raw 4.1 update
    3.2MB
    5/30/2007
    Adobe DNG Converter and Camera Raw 4.1 update

  • I have a problem with the sync between iTunes and ipad2. I can not see the files in iPad. Help me please.

    I have a problem with the sync between iTunes and ipad2. I can not see the files in iPad. Help me please.

    Cannot see what files ? Music (synced music should appear in the iPod app), films/TV shows (Videos app), documents ... ?

  • Help:Can not find the file in jar!

    Hello everyone:
    I build a project using Netbeans 5.0 and make a jar file with it...
    The code in the project as follows will throw an exception described that it can not find the file named datasource-config.xml
    String dataFilePath = getClass().getResource(dataFile).getPath();
    //System.out.println("filepath:"+dataFilePath);
    InputStream input = new FileInputStream(dataFilePath);
    when I run the project with the main() function as an entry it works perfectly and output:
    filepath:/C:/projects/java_project/search/build/classes/com/cn/wxjt/lucene/config/datasource-config.xml
    But when I compressed the project with jar and run it , it will show:
    filepath:file:/C:/projects/java_project/search/dist/search.jar!/com/cn/wxjt/lucene/config/datasource-config.xml
    there is a (!) between search.jar and /com/cn/wxjt...
    I dont know why I generate a ! symbol in the file path... Is it cause the exception->
    java.io.FileNotFoundException: file:\C:\projects\java_project\search\dist\search.jar!\com\cn\wxjt\lucene\config\datasource-config.xml
    If you have any idea, plz tell me.
    Thank you and best wishes to you !
    :)

    If the file you want to read is in your jar file, use
    getClass ().getResourceAsStream
    (relative_path_file_name)Hope that help,
    Jackhey jack i want to open the file as new File
    i m using this.getClass().getResource("resource/backend.xml");
    the resource is the directory inside the jar file.
    when i prints the url it shows:
    the jar file is in the WORK directory
    URL : jar:file:/home/neeraj/WORK/show.jar!/resource/backend.xml
    now when i creates new File using the url.getFile() method the file does not exist.
    although the same programs runs well when i uses the InputStream
    so plz tell me cant I create a new File from the above method????
    thanks in advance
    with regards
    neeraj

  • Move all my music to another folder but Itunes can't find the files!

    I have all my music on my desktop in small folders for each artist.
    But now i don't have room anymore, because i have to much music.
    So i want to move it all in to a folder called "Music". But when i do that
    Itunes can't find the files, and i have to search for each file, to find the new location instead of the desktop. How do i move my music more easily? So i don't have to synchronize it all in again, with the right album covers and that..
    Please, need some help here!

    You need to open your preferences file in iTunes and click on advance then select the location of where you put the folder.  http://support.apple.com/kb/HT4527

  • OneNote recordings "We're sorry, we can't open the file because it is in use by another program."

    Constantly, OneNote breaks and screws up my recordings that are synced with my lectures. It is such a fragile process and very frustrating. As soon as I'm done recording, I press stop. When I test the recording, it says, "We're sorry, we can't open
    the file because it is in use by another program." I just recorded and then stopped it. If i close and reopen OneNote, it says, "oneNote is cleaning up from the last time it was open." And the recording still says it's in use by another program.
    I've even restarted the laptop and it still won't open. The only way i could salvage the file is if I copy and paste it into another folder, and then it will open through windows media player, but all the live syncing with my notes are gone. Where are these
    files stored? If I could save the sound and find the file/format that holds the syncing data again, I could work around this. They are no where to be found on my computer. Other forums give locations, but my folders are empty. Some other recordings work and
    sync nicely, but I have still lost many recordings to this error. However, if I play a file and then close it without stopping playback, that file, too, will now be unusable. It will be stuck as "We're sorry, we can't open..." no matter what i do
    and again i have to copy/paste it into a new folder and then move it back. I had the same problem on my last laptop. I record in Windows Media Audio 10 Professional at 192 kbs, 48 kHz, and stereo CBR. I need the high quality because the lecturer is too quiet.
    It seems to happen when I record long lectures, 45 min+. Shorter recordings tend to work fine.
    Please help, this would make note taking so much easier.

    A bit of a confusion on my part;
    Now we have created these REPORTS using Basic Crystal Report 10.5, which comes bundled with Visual Studio 2008 and .Net Framework 3.0. Now on our machines, we have never experienced any issues.
    Going by the above, you should have references to CR assemblies of version 10.5.3700 only. No other references.
    Now, looking at this paragraph:
    BUT on the DEV server (web server) which has .net Framework 3.0 and in its GAC its has CRYSTAL DLLs version 11.5 (required to create an Object of ReportClass and its related functions) ; sometimes we get the following error while exporting crystal report to pdf:
    I wonder what runtime was deployed to the server. E.g.; if you are using CR 10.5, your assemblies will be 10.5.3700 and you should be deploying the following runtime (depending on 32 bit / 64 bit, etc.):
    CRRedist2008_ia64.msi
    https://smpdl.sap-ag.de/~sapidp/012002523100006255262008E/CRRedist2008_ia64.zip
    CRRedist2008_x64.msi
    https://smpdl.sap-ag.de/~sapidp/012002523100006255272008E/CRRedist2008_x64.zip
    CRRedist2008_x86.msi
    https://smpdl.sap-ag.de/~sapidp/012002523100009351342008E/CRBasicVS2008_redist_x86.zip
    One way to check on what is actually loading is to use the [Modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] utility.
    - Ludek

  • I downloaded an Adobe file from my email but cannot find it on my hard drive or in recycle bin - it's in downloads but am unable to open from downloads - how can I recover the file?

    I downloaded an Adobe file from my email (service provider is MWeb) but now cannot find it on my hard drive and it's not in the recycle bin. It does, however, appear in Firefox downloads but I'm unable to open it from there. How can I recover the file?

    Thanks Rob.
    I actually had no clue what the core problem was caused by. So it's Windows itself...that helps some.
    I'll resubmit there. It might actually have saved time for it to simply have been moved to there instead of off-topic, though I suppose you have to follow protocol.

Maybe you are looking for

  • Questions on the Effects settings

    Well, the next thing that somewhat throws me is the use of the special effects.  For example, when I clicked on the special effects for a particular object it always comes up with Bevel and Emboss and Directional Feather checked.  I typically have to

  • Video and audio not in sync

    Anybody else experiencing video & audio not in sync since upgrading to Lion? I have a MacBook Pro 15-inch, Early 2011 with AMD Radeon HD 6490M 256 MB graphics. I mostly stream You Tube, Netflix, & news videos and occasionally watch movies I have in i

  • Vendor returns with 161 movement type

    Hi Friends,                      We have gone live recently. I have to return Excisable materials to vendor. I have created return purchase order.How to create excise invoice for this? Regards,

  • A dynamic tree question

    i have found some example about how to create dynamic trees... and also found and example wich is similiar to my case on how to Building a hierarchical tree from recursive tables(Frank Nimphius' Blogbuster).... i have a answer.... i want for the same

  • I can not access my hard disk protected by Bitlocker drive despite the right recovery key

    I had locked my 1 TB harddisk 1 year back with BitLocker Drive. I have been using its recovery key to unlock it since then. But since 3 days back, it has been displaying the message " Error recovering disk. The recovery key entered is not correct, tr