Delete file from original location and when copied size of file increases.

hi !
I have 2 exe's both of 1.15MB which I want to move to another folder. The files are copied to the folder but the size of exe increases to around 350MB each. What can be the problem ?
BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream(filename));
int o=bis.read();
do{bos.write(o);}while (o!=-1);
boolean del=this.fpara.delete();
System.out.println(del);          Also, the file is not deleted from the original location even though I have used the delete function. The last line produces null output.

And do follow coding conventions
{color:0000ff}http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html{color}
If your original source is all jammed up like the snippet you posted, I'm not surprosed that you can't spot your mistakes.
db
Edited by: Darryl.Burke on Mar 9, 2008 12:40 AM

Similar Messages

  • Transferring files from original imac AND external CD for old imac

    I have an original iMac that has tons of files on it I would like to save.  I created a LOT of materials when I was teaching and they are all on the old iMac.  It also has two games I bought on floppy discs that I would really like to keep.  I tried to load files on a Passport, but the iMac won't recognize it.  I have two other old iMacs (not quite originals) as well, but they won't take the Passport either.  They will both take a flash drive.  I can take word processing files (I can't even remember the application at the moment) off the older one and convert them to Apple Works on the other one, then take the converted files to our iMac 9.1 and convert them to Pages.  Then I put them on the Passport.  It is a pain, but at least it works.  I can also save the documents as pdfs and put them directly on the newer iMac and copy and paste in a Pages document. 
    The original iMac does not lend itself to any of this.  What is the best way to transfer files?  It seems like a very long time ago I tried to connect it to my newer iMac with an Ethernet cable but it wouldn't accept the cable.  If I am remembering correctly I called Apple Support and they said it lacked something that would allow it to connect.  I do not remember if I have tried a flash drive on it or not.  I believe I did and it would not recognize it. 
    Also, does anyone know how I can manage to save a copy of the games?  Since I bought them on floppies I can't reinstall them if something happens, but I believe it is within the law to make a backup copy.  Someone please correct me if I am wrong.  I do have an external floppy reader for the original iMac, but it only works on user created floppies, not commercial ones.  If I can manage to hook up to a flash drive or another computer and I simply save the game application, will that be enough?  Or is it not possible to know until I try?  Will saving the application get all the necessary files? 
    My second question concerns the newer (but still really old) iMacs.  My daughter would love to play some of the games she used to play on them, but the CD drives do not work.  Does anyone know where I can get an external CD drive that we can attach to these old iMacs so she can enjoy her games?  The computers work fine; she just can't insert the CDs, because it's next to impossible to get them out again. 
    I believe on the "newer" two we are running OS 9, at least on one of them.  I do not recall the OS on the original, but it is whatever it came with.  OS 8, perhaps?  It has been probably half a year since we fired it up. 
    I appreciate any advice and help anyone can give me.  We really like these old iMacs, which is why we still have three of them.  If we can save the files off the original iMac, we would still keep it so we could play our two old games from time to time.  :-)  I would part with one of the other old iMacs, but I really need to get the files first, and since it won't take a Passport I'm wondering if I'm stuck putting files a few at a time on a flash drive.  Do you think it would take an ethernet cable?  It seems like I tried to connect to my newer iMac but I couldn't get the computers to recognize each other.  I followed all the steps for sharing, but I still couldn't get it to work. 
    Thank you so much. 

    Have you formatted the Western Digital Passport drive as a Mac OS Extended (HFS+) volume, or is it factory-formatted for PCs?  If the oldest iMac is only running OS 8, it can't recognize HFS+ volumes.  It was OS 8.1 that introduced that feature.  Additionally, the version of the USB support files (which is somewhat OS-dependent) on the iMacs hard drives affects what will or will not be recognized by those older computers.  With each successive release of the USB Adapter Support, the database of supported devices was broadened.  The easiest way to transfer the contents of the iMac's hard drive is to physically remove it from the computer and connect a USB-to-IDE adapter directly to it.  These adapters come with an external power supply to provide the 12 & 5 volts needed to power the drive.  The data connection block is designed to fit either a 3.5" hard drive or the smaller 2.5" laptop drive, as well as newer drives that connect via SATA.  It has an included USB cable that connects to a standard USB port, enabling direct reading/writing/file transfers from the hard drive to the computer to which it's connected.  These adapters are not Mac-specific in terms of design, so you can buy one at a PC store and use it.  For the purpose of identifying such an adapter, here's one that's often recommended in these Forums, carried by Other World Computing.  As I mentioned, this adapter is not platform-specific, so you can buy/use a less expensive one sold by PCs stores.  I bought one for $15 from Micro Center (PC store), and it has worked with Macs and PCs.  As for removing the hard drive from the old iMac - and I assume that it's one of the original models with a tray-loading optical drive (as opposed to the slightly newer ones that have a slot-loading optical drive), you can find directions for accomplishing that if you do a web search.  The link that I had for one site (that was good for years) is no longer valid.  The iMacs that have a problem ejecting disks are undoubtedly slot-loading models.  There are two wide rubber rollers inside those optical drives that grip the disk to pull it in or feed it out.  Over time, the rubber dries out, causing the rollers to lose their natural gripping capabilities.  If those iMacs have a FireWire port on the side, I'd suggest an external FireWire optical drive.  Today, the only type you'll find is a DVD±RW drive, which is more than you need for your intended purpose.  A basic CD-ROM drive isn't manufactured/sold anymore.  Other World Computing has a few FireWire optical drives, but their least expensive model sells for about $100.  Obviously, that costs more than the value of the entire iMac at this point, but the drive will also have USB connectivity as well.  You may find other uses for it with your other computers (Macs & PCs), especially if they don't have a CD-R, CD-RW, DVD-ROM, or DVD±RW drive.  As for transferring a program itself, there could be other associated files.  You'd want to check the Extensions and Control Panels folders for any that are named to likely indicate being a part of the program's installed files.  The Preferences folder will probably have a file that has saved game settings, but a new one would be created when you run the program in another supported computer.  Depending on the age of the program - and you indicated that it was on floppy disks - its compatibility with newer, pre-OS X releases might be limited.  The external USB floppy drive that you use with the older iMac should read commercial floppy disks, but it will not recognize the older 800K (Double-Density) Mac-formatted floppy disks.  They're disks that typically format as 720K floppies in a PC, but the variable-speed FDD in older Power Macs was able to fit an extra 80K of data onto those disks.  A standard 720K "PC" floppy disk should be read by that drive, but it can't recognize an 800K "Mac" disk.  A 720K/800K Double-Density floppy disk only has the slide-lock hole at one corner, while a High-Density (1.44 MB) floppy disk has an additional hole at the opposite corner to differentiate it from the older type.

  • Creating pdf files from word document and allow copying of content

    I generate word documents and then save them in PDF format before sending out to clients.  Sometimes these documents contain quite a lot of data in table format and I want my clients to be able to copy the data from the tables and be able to paste it into excel.  How do I save as PDF and still allow copying of content?
    Thanks

    Open such a PDF in Adobe Reader: File | Properties | tab Security.  It will tell you if copying is allowed or not.
    I don't know if you can change these security options from Word; you'll have to ask Microsoft.  To change them after the PDF was created, you will need Acrobat.

  • How can One sender communication channel pick two file from two location

    Hello
    I have a requirement that how can One sender communication channel pick two file from two location.Both the file has same name...How to configure the one receiver communication channel.i dont have any IR,no mapping..Please help me...

    >
    Soumitra Sinha wrote:
    > Hello Vijay
    > I already done the adapter specific message attribute.i am getting the file name properly.but that is nothing to do with my req.i am again clearing my problem:
    > i have two folder   folder a,folder b.Both has the same file credit0002. i have two destination folder i have one sender and one receiver channel.I dont have any IR.How one sender channel can  pick file from two location and how one receiver channel can put in two location.please help me..
    Ok now I get your requirement.
    you cant achieve this -  how one receiver channel can put in two location if you dont have a dynamic configuration defined i.e Adapter specific attributes.
    easy way - involve IR mapping
    else
    have a adapter module to define your dynamic configuration.
    Ref: /people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules & /people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further
    Set the dynamic directory/file name etc for your receiver adapter.

  • After restarting my computer firefox is deleted for Windows, when i try to open firefox a message pops up saying the program has been moved from its original location and is unable to run How do I get Firefox on my computer permanently?

    After restarting my computer firefox is deleted for Windows, when i try to open firefox a message pops up saying the program has been moved from its original location and is unable to run How do I get Firefox on my computer permanently?

    I have tried everything I could to fix this, but some things require actually being on Firefox, and since I cannot get on, I cannot click on the tabs to do it. I have even totally uninstalled firefox, and that has not fixed this. I still get the same message that firefox is running and I need to close it or restart (which I have also tried dozens of times). I have removed things like Java, and that has not helped either. If I cannot even get on line in firefox, how can I fix this. I am not crazy about using internet explorer, but right now, it is my only option. I even tried to start in safe mode, and the same message box pops up!

  • When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    When I update itunes it deletes the library file, and when I restore that file from the previous libraries or my backup, itunes will run but tell me "the iTunes library file cannot be saved. A folder was specified instead of a file" How do I fix this?

    Hi there Br0x,
    You may want to try rebuilding the iTunes library as an initial troubleshooting step. Take a look at the article below for more information.
    iTunes: How to re-create your iTunes library and playlists
    http://support.apple.com/kb/ht1451
    -Griff W.

  • After refomatting HDD, reinstalling Vista plus service packs, recovering files from Microsoft backup and installing new copy of Firefox 3.6, Firefox will not run. Have deleted all old M0zilla profile folders and reinstalled Firefox again to no avail.

    After computer would not boot and could not be repaired, I reformatted the HDD, reinstalled Vista plus all service packs and updates, recovered files from Microsoft backup and installed new copy of Firefox 3.6. Firefox will not run.
    I have deleted all old M0zilla profile folders and reinstalled Firefox again to no avail.
    After intallation was completed, the automatic startup just placed a small box on the screen "Import wiz". This just sat there with no activity. After I closed this box, none of the Firefox start buttons would open the program -- just the blue rotating icon for about 2 seconds then nothing.

    Hi,
    Please try to rebuil the WMI repository.
    For detailed information, please refer to the blog below,
    http://blogs.technet.com/b/askperf/archive/2009/04/13/wmi-rebuilding-the-wmi-repository.aspx
    If issue persists, due to sfc doesn't work, could you try to repair your system with the installation disk?
    Best Regards.
    Steven Lee
    TechNet Community Support

  • My macbook pro keeps saying I have 450 gigabytes out of 500 that are used.  But when I look on finder there are no files that are anywhere close to that amount.  I went through and deleted files from my mac and now I only have 10 gs free

    My macbook pro keeps saying I have 450 gigabytes out of 500 that are used.  But when I look on finder there are no files that are anywhere close to that amount.  I went through and deleted files from my mac and now I only have 10 gigabytes of additional space free. My mac now says I have 440 gigs of other that is used. But does not make sense, do I have a virus?

    Since you have not identified the OS your MBP is using, these extract may or may not assist you.
    http://pondini.org/OSX/LionStorage.html
    http://pondini.org/OSX/DiskSpace.html
    You may also download from the Internet OmniDiskSweeper (free) and open it it will show all of the files on your MBP and the respective sizes.
    ciao.

  • I am using an expense tracker and when I export the file for use it says it is in location /var/mobile/applications/666E-4BC6-8FF1-50CAD35FA541/documents/MyExpenses.csv where do I find this? Assistance greatly appreciated

    I am using an expense tracker and when I export the file for use it says it is in location /var/mobile/applications/666E-4BC6-8FF1-50CAD35FA541/documents/MyExpenses.csv where do I find this? Assistance greatly appreciated

    Attached is Dennis Linam’s Audition – “Log File” and “Log – Last File”
    Contact information Dennis [email protected]
    Previous contact information with your organization (DURIM):
    Dennis - i just finished my audition trial and bought the subscription the 2014 version.
    created by durin in Audition CS5.5, CS6 & CC - View the full discussion 
    DURIM - Okay.  I would expect the "Cache Warning" message because your default directories would not be the same as the ones in the settings file I generated.
    If you go back to the "7.0" directory and open the "Logs" folder, can you copy the "Audition Log.txt" file and send it as an attachment to [email protected]?  We'll take a look in that logfile and see if it gives us more information about why this is failing now.
    Also, do you have any other Adobe applications installed on this machine, such as Premiere Pro?  If so, do they launch as expected or fail as well?
    I do have the trial Pro version of Adobe reader, but I have not activated it, because I fear the same thing will happen did it. I cannot afford to activate the subscription for that product and take the chance of it not working either. I depend on those two programs religiously. Here is the files that you requested. I appreciate any help you can give me to get this audition program started
    Audition Log- file
    Ticks = 16       C:\Program Files (x86)\Common Files\Adobe\dynamiclink\7.0\dynamiclinkmanager.exe
    Sent from Windows Mail

  • How to copy file from  one location to another

    Hi,
    I am new to java, I tried the following code to move the file from one location to another
    public class CopyFiles {
    public String copy ( File source, File target)
    throws IOException {   
    FileChannel sourceChannel = null;
    FileChannel targetChannel =null;
    try {   
    sourceChannel =new FileInputStream(source).getChannel();
    targetChannel= new FileOutputStream(target).getChannel();
    targetChannel.transferFrom(sourceChannel, 0,
    sourceChannel.size());
    finally {   
    targetChannel.close();
    sourceChannel.close();
    return "Success";
    public static void main(String [] args) throws Exception{   
    File source = new File("C:\\users\\download.pdf");
    File destinationFile = new File("C:\\apple\\download.pdf");
    copy(source, destinationFile);
    The above code is working perfectly, but I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.

    kameshb wrote:
    I Don't want to include the file name in destination file. i.e. File destinationFile=new File("C:\\apple"), and at the same time the pdf with same name has to get stored in the destination location, how can I achieve this.It's not totally clear what you're saying here, but what I think you mean is that you don't want to explicitly set the destination file name--you want to just give the copy the same name as the original. Yes?
    If that's the case, then break the original up into separate directory and file name portions, and then construct the destination path from the destination directory plus original file name. You can do that by manipulating the full path string, or by using the methods in java.io.File.

  • Error message when copying a music file from PC to BB

    I get the following error message when copying a music file. Also I cannot delete any files.
    "Cannot copy. The request could not be performed because of an I/O device error."

    Hello lcoyote and welcome to the BlackBerry Support Community Forums.
    Do you get the error on all media files or just one in particular? From where are you trying to delete files?
    Is your media card formatted? 
    If you aren't able to add/remove media, try formatting the card as shown in KB10527
    If you currently have photos on the card, try to move them to the computer first as formatting the card will delete all data.
    Let me know how you make out
    Thanks!
    -HMthePirate
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Is it possible to allow iphoto to delete fotos from the finder? (when iphoto doesnt copy the fotos into an own library)

    Is it possible to allow iphoto to delete fotos from the finder? (when iphoto doesnt copy the fotos into an own library)

    No  -- iPhoto does not ever touch an photo file that is not within its database
    THis is one (of the minior) resaons that it is very strongly advised not to uncheck the preference to copy imported items to the iPhoto library - it makes importing and deleting more difficult and makes upgrading or replacing defective hardware much, much more difficult
    LN

  • I am new to mac. just purchaased it 3 weeks ag along with MS office for mac, i notice that all my outlook email are in this finder folder, can i delete these email files from this location? why are they there anyway?

    I am new to mac. just purchaased it 3 weeks ag along with MS office for mac, i notice that all my outlook email are in this finder folder, can i delete these email files from this location? why are they there anyway?

    Cherry63 wrote:
    I am talking about the icon on the docking row, that's the guy with the smily face. When you click on him it brings up a bunch of files of what I seem to have store/created on my Imac. There are hundreds of emails and some other documents. I tried to delete a few of them when I first got the MS office but it did not like that, it said it have to rebuild oulook. Why cant i delete these files? is this Apple version of Window outlook PST files?
    These file extenssions are listed as
    olk14_message or even or ccontact. I wish I could send a screen print but I dont see that on the key board. Maybe I should have stuck with windows..
    Oh the ...olk14_message's.  Do not delete them behind Outlooks back, i.e., from the finder.  Those are the various messages that you sent, received, or deleted in Outlook.  They are indexed by Outlook so if you delete behind Outlook's back Outlook will get confused trying to access those messages.
    You can delete them however using Outlook itself.  In outlook select a mailbox (Drafts, Sent Items, Deleted Items, etc.) by clicking on the mailbox on the left.  It will show you the messages in that mailbox.  You can now select all or selected items in that mailbox.  The click the Edit menu and select Delete.  You will get a dialog asking if you really want to delete the selections.  Answer "Delete" and the messages will get deleted.
    The olk14_message's you are seeing are the actual messages shown the Outlook mail boxes.  When you actually delete them the way I just described the corresponding olk14_message files will also be deleted.
    Note Outlook's Deleted Items mailbox is where all deleted messages go when you click the Delete tool in the Outlook toolbar.   Thus using the Delete tool from the toolbar does not permanently delete the messages.  So if you been using that for months or years you are going to have a very large Deleted Items mailbox.  And every one of those items in there is going to have a corresponding olk14_message file for that message.
    So if those olk14_message files you are seeing are from the Deleted Items mailbox you can get rid of all those corresponding olk14_message files by selecting all the messages in Deleted Items and using the Edit menu's Delete.
    Alternative ways to the Edit/Delete to do the permanent delete is select (all) the messages to delete and control (right) click to bring up the Outlook contextual menu and select Delete from it.
    Finally if you use the Delete tool in the toolbar for messages selected in the Deleted Items mailbox you will be able to permanently delete those too.  It's an exception since using the tool on the Deleted Items means there's no place to put those messages except to "oblivion".
    So, in summary, using the Delete tool in the toolbar on messages in every mailbox except the Deleted Items mailbox just moves messages to the Deleted Items mailbox.  But using the Delete tool on items in them Deleted Items mailbox permanently deletes the selected items in there.  And only permanently deleting items removes the corresponding actual ...olk14_message files.

  • Delete File from URL located on HTTP Server.

    Hello All, could you anybody help me with my Problem. I need to delete some File in URL located on HTTP Server. The File was created via using of the Function 'DP_CONTROL_SEND_STREAM_TO_URL'. Any Times I need to delete this File from the url Location, but I cann't find any Functions or Method of any Class (GUI 6.20) to realise that. I read lot of very good Blogs from Thomas Jung about HTTP classes, but I cann't find somthing relevant for me...
    Sincerely Yours,
    Lubomir

    Hi,
    You can try with GUI_DELETE_FILE and give http location in FILE_NAME
    or WS_FILE_DELETE.
    I am not getting any CNDP function module for your purpose.
    Hope you will get sucess..
    Thanks,
    Chetan Shah

  • Copy file from a location to another

    I work on a Java process that must be optimized and I have some questions.
    This process includes a part of copying a file from a location from another (to be more specific, all files that exist in a directory, to copy in another directory), wich technique is more efficient and quickly? To copy using FileInputStream/FileOutputStream in Java or using a java Runtime process that calls a copy command of the Operating System?

    I work on a Java process that must be optimized and I
    have some questions.
    This process includes a part of copying a file from a
    location from another (to be more specific, all files
    that exist in a directory, to copy in another
    directory), wich technique is more efficient and
    quickly? To copy using
    FileInputStream/FileOutputStream in Java or using a
    java Runtime process that calls a copy command of the
    Operating System?Neither. Use the FileChannels in the nio package if you can:
    /* Note:  Proper resource closing and exception handling is not done here */
    try {
            // Create channel on the source
            FileChannel srcChannel = new
            FileInputStream("srcFilename").getChannel();
            // Create channel on the destination
            FileChannel dstChannel = new
            FileOutputStream("dstFilename").getChannel();
            // Copy file contents from source to destination
            dstChannel.transferFrom(srcChannel, 0, srcChannel.size());
            // Close the channels
            srcChannel.close();
            dstChannel.close();
        } catch (IOException e) {
        }Spawning a Runtime process is probably the least efficient way to do it.
    - N

Maybe you are looking for