Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6120037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:37:21+00:00 2026-05-23T15:37:21+00:00

Update: Ehh — Even though this question isn’t answered, I’ve just emptied my pockets

  • 0

Update:

Ehh — Even though this question isn’t “answered”, I’ve just emptied my pockets and purchased an SSD. My ramdisk software was going to cost just about as much anyway. I’m not particularly interested in an answer here anymore, so I’ll just mark this as “answered” and go on with my life.

Thanks for the help.


I’ve got a program which is writing files to a ramdisk (in Windows XP) and I need to copy its data from the ramdisk to a directory on my harddrive once it has finished execution. Obviously in a ramdisk the space is limited and I need to free up as much space on the ramdisk as I can between runs. The simple solution is to copy the data folder that my program generates on the ramdisk to a location on the harddisk and recursively delete the “data” folder from the ramdisk.

There is a problem with that solution however; my program looks at the filesystem and filenames to ensure that it doesn’t overwrite files (The most recent data file in the directory is 006.dat, so it will write 007.dat instead of overwriting anything). I can’t just delete the files once I’m done writing data because it needs that filesystem intact to record data without over-writing the old files when I copy the data back to my hard-drive

I’d like a simple little windows batch script which I can execute after my program has finished writing data files to the ramdisk. This batch script should copy the ramdisk “data” folder to my harddisk and delete all the files from the ramdisk, then it should re-create the filesystem as it was but with all zero-byte files.

How would I go about this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:37:22+00:00Added an answer on May 23, 2026 at 3:37 pm

    Could you simply have it delete all files EXCEPT the most recent, then you would still have 006 and your logger would generate 007?

    That seems safer than creating a zero length file because you would have to make sure it wasn’t copied over the real 006 on the backup.

    edit: Sorry can’t help with how to do this solely in batch, but there are a bunch of unix utils, specifically find and touch that are perfect for this. There are numerous windows ports of these – search on SO for options.

    Robocopy.exe (free download in the windows server resource kit) can do copy from one dir to another AND has the option to watch a dir for new files and copy them when they are closed or changed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: this question has been answered (see below). I'll leave it up in case
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: Please read this question in the context of design principles, elegance, expression of
Update So in my Original question I was just frustrated because I was being
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
Update: Thanks for the suggestions guys. After further research, I’ve reformulated the question here:
Update : this is more-or-less a dupe , and it turns out to be
UPDATE - No need to answer this now, I have solved below. Hi, I'm
Update : Gutted entire question with more thorough description Ok same question with different
Update : Clarified and expanded, since the original question was simplified too far I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.