Rename, than delete the old file!

Hy to all. I have an application which searches all the .txt files from a directory, than modify it's content, creates new file with the name of the old one + .tmp ending, then copies the modified content to is, deletes the old files and renames the new ones to the name of the old ones. My problem is that the renaming and delete does not work.can u help me with??? Some code please.Thanks!

No, you provide your code. Use the CODE button or [code] and [/code] tags to make it readable.
Provide just an SSCCE, as nobody wants to read through an entire application just to find problems with file manipulation.
And describe precisely what "doesn't work." means.

Similar Messages

  • How to update my ipod without deleting the old files?

    i have 2 pc and different songs on them..but whenever i want to update my ipod from the second one ..it keeps telling that my ipod is linked to another itune and uploading will delete the old file..would someone tell me how to go around it?..thanks
      Windows XP Pro  

    Connect your iPod and when you get the message that it is linked to a different library and asking if you want to link to this one and replace all your songs etc, press *No*. Pressing "Yes" will irretrievably remove all songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual as per the link below.
    You can also use a keyboard command to prevent your iPod auto-syncing with iTunes. While connecting the iPod to the computer on Windows hold down the Shift + Ctrl keys (on a Mac hold down the Option and Command (⌥ and ⌘) keys). This will stop the iPod from auto-syncing with iTunes and the iPod will appear in the source list. Wait until you are sure the iPod has mounted, and that it will not auto sync and then you can let the keys go. This may take between 20 to 30 seconds depending on your computer. Then go to Edit>Preferences>iPod and check the "Manually manage songs and playlists" box: Managing Your Songs Manually

  • ITunes 10.2 doesn't replace and delete the old file

    i'm using iTunes 10.2 for Windows 7 32bit, when i replace the old .ipa files with the new version .ipa files it doesn't delete the old .ipa, so i have 2 .ipa files, this is bug or not? if not, how can i setting to replace and delete the old .ipa version?

    iTunes v10.2.1 doesn't fix this issue and nobody answer this nubie question

  • HT201250 what do I do if my passport for mac does not delete the old files when the disc is full

    What do I do  if the time machine does not delete the oldest files on my passport for mac. I get the message backup failed not enough disc space available

    See Pondini's TM FAQs, for starters.

  • How can I delete an old file from my library on iTunes

    Occasionally I have to replace PDF manuals with ones that have been updated.  But after I sync the new file the old one remains on my Mac itunes library.  How can I delete the old file?  So far all I do is deselect the old file but it's still there.  Sooner or later there will be more old files then current ones making it hard to manage.
    Thanks in advance.

    You can do this with or without the iPad connected to your Mac.
    Launch iTunes on the Mac. Click on Books under the Library heading. Click on the PDFs. Then click on the PDF that you want to delete in order to select it, and go to Edit>Delete and follow the on screen prompts.
    if you are using iTunes 11 and do not have the sidebar enabled, and wish to do so, go to View>Show sidebar or use the keyboard shortcut OPTION+Command+S.
    If you do not want to enable the sidebar, the library items can be accessed in the button in the upper left corner of the iTunes window.

  • I have created a new profile and copied firefox files from my old computer into it. How do I switch to the new profile, do I just delete the old one?

    I am running windows 7 I had to recover my files from an external hard drive when my old computer crashed. I have created a new profiles as outlined in the firefox website and copied all the files into it. I just need to know how to use this new profile when I open firefox, do I just delete the old profile? Or do I have to reinstall firefox.

    If you no longer need or intent to use that older profile then you can use the Profile Manager to remove that profile and delete the files.
    *http://kb.mozillazine.org/Profile_Manager
    *http://kb.mozillazine.org/Backing_up_and_restoring_bookmarks_-_Firefox
    *http://kb.mozillazine.org/Profile_backup

  • My 2 TB Time Capsule's memory is full because it will not automatically delete old files as it is supposed to, so it is giving me zero backup of my two computers now.  How can this be fixed so my Time Capsule deletes the old data and saves the new?

    My 2 TB Time Capsule’s memory is full because it will notautomatically delete old files as it is supposed to, so it is giving me zerobackup of my two computers now. How can this be fixed so my Time Capsule deletes the old data and savesthe new?
    Neither my local computer consultant nor I have been ableto change any of the settings in Time Machine to correct this problem.  Working with the choices in the TimeMachine, there does not appear that there is any way to change the frequency ofthe backups either, so, after a year has elapsed, the time capsule is full, andmy only choice appears to be to erase all the current data on the Time Capsuleand start over, something that I do not want to at all let alone repeat on anannual basis.  My questions are:
    What can be done to have my Time Capsule delete old filesas it is supposed to do, so it has memory available to allow my computers toback up? 
    Is this a software problem that can be fixed online or isdoes this require a mechanical fix of defective hardware?

    How much data is being backed-up from each Mac?  (see what's shown for Estimated size of full backup under the exclusions box in Time Machine Prefs > Options).
    Is there any other data on your Time Capsule, besides the backups?
    Most likely, there just isn't room.  Time Machine may be trying to do a very large (or full) backup of one or both Macs, and can't.  Since it won't ever delete the most recent backup, there has to be enough room for one full backup plus whatever it's trying to back up now, plus 20% (for workspace).
    Also see #C4 in Time Machine - Troubleshooting for more details.

  • Deleting the old Archive Log Files from the Hard Disk

    Hello All,
    I want to delete the old archive files of Oracle. These files are very old and consuming very huge disk space.
    Is there any way by which I can delete these files from the Hard Disk?
    Can I directly delete them using the Operating System Command?
    Will it cause any dilfference to the normal functioning of my Database?
    If I need to delete these files, do I need to bring the database down?
    Please guide me.
    I need to do this activity to make some space free on the Hard Disk.
    Thanks in advance.
    Himanshu

    Hi.
    Keep archived logs from time of last backup and forward to currenct time on disk together with the backup itself. And keep older archived logs together with older warm/cold backupfiles on tape as long as there is enough capasity or following your recovery strategy. This way you might be able to roll forward a recovery without restoring these files from tape which often the faster.
    Older archived logs can be deleted manually, with scheduled OS script or automatically with RMAN.
    Good luck
    rgds
    Kjell Ove

  • Evevy song i have is duplicated, i try to delete the old one, but if i do, the new one dissapears also, i saw at the explorer window and every song is just one file

    My library is duplicated, i did what the support suggest but if i delete the old song the new one also dissapears, i reviewed the windows file and only appears one file, i try to find an answer but do not have yet any.

    I've written a script called DeDuper which can help remove unwanted duplicates. See this  thread for background.
    tt2

  • Need to delete the old page number from a combined file and replace it with the new number. is there a way for me to do that using JavaScipt

    is there a way of using JS to delete the old page number (1,3,32,78) on a combined PDF and inset it with a new page numbers (1,2,3,4) Thank you

    Depends. If the page numbers can be located by their location on the page then a script can be written to redact that area, and then add new page numbers in their place (or somewhere else).

  • Firefox does not delete the .part file from my download folder after a successful download

    First off, I'm on a MacBook Pro, running 10.6.4 and FF3.6.12
    I've recently noticed that on occasion Firefox does not seem to delete the .part file associated with a successful download. The .part file (with a name consisting of a string of random characters followed by a .part extension) is visible in my Download folder stack, although not visible in the actual folder view. I cannot drag this file from the stack to the trash.
    The real problem stems from the fact that this seems to create a directory error on my hard drive. Were I to run Disk Utility (which I will have to do... again!), it would return with an error saying something like "incorrect block length", requiring me to boot up from my install disk and repair the drive.
    Is this maybe a bug? Is there something I might be doing wrong? Could an extension like AdBlock be messing up my downloads?

    It seems that FireFox leaves those partial download files if for any reason they get interrupted. It's possible to resume the download through various uninteresting means, but if you're like me, it gets filled up with files that I intentionally did not complete downloading.
    If you're terminal-savvy, you can set up a script that cleans up old .part files. Here's what I've set in my crontab:
    0 * * * * /usr/bin/find ~/Downloads/*.part -atime +1 -exec rm {} \; &> /dev/null
    It will delete any files in my downloads folder that are at least 1 day old.
    To install this in your crontab, launch terminal and type "crontab -e"
    This will bring up a text editor, probably vi. You'll see a bunch of ~'s down the left side. Type "i" to go into "insert" mode. The bottom left will say "-- INSERT --"
    Copy and paste (or type) the line of code I have above.
    Hit enter just to make sure you have a newline at the end.
    Hit "Escape" to exit the insert mode.
    Hit Shift-Z Shift-Z (that's Shift-Z twice) to exit the editor.
    You should see a status message "crontab: installing new crontab"
    If you type "crontab -l" you should see your newly installed crontab.
    At the top of the next hour, any .part files that are more than a day old should be deleted, and this should continue forever.

  • HT3842 Does iTunes store the original music file and copy it into a separate folder? If i delete the original file from finder will it remove it from my iTunes library?

    Hi, on my last PC when transferring music to my new MacBook Pro i noticed i had about 6 duplicated of each song in every album i took hours in removing them.
    I Just wondered Does iTunes store the original music file and then copy it into a separate folder?
    If i delete the original file from finder will it remove it from my iTunes library or vice versa. I didnt want to lose any music like i have some how managed to on my old computer.
    Or should i keep both files of it in the Music folder and also iTunes library folder?
    Which is best ?

    DrewPowell wrote:
    I Just wondered Does iTunes store the original music file and then copy it into a separate folder?
    It does both at the same time.
    When you add files to iTunes, it copies them into /Music/iTunes/iTunes media/ folder. The original file remains where it was.
    You can drag a file to /Music/iTunes/iTunes media/Automatically add to iTunes/ folder.
    This will add to iTunes and move it to /Music/iTunes/iTunes media/.
    I keep a shortcut of this folder on my desktop then simply drag files to the shortcut to add to iTunes.
    Then there are no "extra" files around.

  • Why does the new operating system not delete the moved files from their original location - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it

    Why does the new operating system not delete the moved files from their original locations - it seems like an enormous waste of space, time and effort to clean up every file once you've moved it - also, when transferring large amounts of files it becomes a very large problem remembering which files were transferred and which not.

    You're going to need to be more specific, as I'm not quite sure I understand what you're talking about.
    If you're referring to copying from an external hard drive or flash drive, and you want to actually move files rather than copy them, you can hold down the option key to force it to do a "move" rather than a "copy." This is not new behavior, though... the Mac OS has worked this way as long as I can recall (and I've been using it since 1984).
    If you're having a problem with trying to move files from one place to another on a single drive causing them to be copied instead, that is likely because of some permissions issue preventing you from actually being able to move them.

  • How to delete the old ones?

    While struggling to clean up my system, and from an abundance of caution, I have created a lot of Catalog Saves, Backups, and Restores.  Now I am concerned about how to clean these up, without scrambling something else up in PSE.  I have searched all the help files that I am aware of.  Can someone please tell me where to look for guidance, or tell me how?  Can I simply delete the old, out-of-date ones; or is there a formal "within-PSE" file management control that I need to follow?  I'm still on PSE4.0.  Thank you very much for any guidance.

    Do you mean the trashed documents are still showing up in the Recent Files list:
    If so, that's normal behaviour. The highlighted file was placed in the trash immediately before I opened this menu and took the screen shot.
    Placing a file in the Trash does NOT delete the file from your hard drive. Here's a shot of the same menu, this one taken after Emptying the Trash (Finder menu, in the Finder).
    The BB file no longer appears in the menu, but even now, it's not actually deleted from the hard drive.
    Empty the Trash does nothing to the actual file. It does delete (or re-write) the directory entry pointing to that file's location on the disk, and marks the space as 'available.' The file information remains on the disk until it is overwritten by other files as the Mac OS makes use of the available space.
    If you want to actually 'remove' the file, use Secure Empty Trash. Using this command results in the actual file information being repeatedly overwritten (with 1s, 0s, or a random series of these two states). Usually unnecessary, and much more time consuming that simply removing the directory entry and making the space available.
    Regards,
    Barry

  • How to delete "windows.old" file in local disk C:

    At the begining of the system he ask for selecting operating system but I use only win 8 so want to delete other os. 
    What should I do ?

    Hi,
    To delete Windows.old file, you should use DISK cleanup in drive properties.
    To delete the item during system boot option, WIN+R, open
    Run, type msconfig, then Switch to boot. Delete the boot item which you want.
    Roger Lu
    TechNet Community Support

Maybe you are looking for