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

  • SEARCH
  • Home
  • 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 8384599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:26:36+00:00 2026-06-09T17:26:36+00:00

My goal is to build a program that renames all files in the current

  • 0

My goal is to build a program that renames all files in the current working directory so they don’t have any spaces, any special characters or any accented characters (for example É would become E). I’m planning on using int rename(const char *oldname, const char *newname); . My problem is how do I get the files in the current working directory? I would like to have the executable I’m creating put in a folder with a files with bad names and run it and the files all be renamed.

A platform independent solution would be preferable, otherwise I’m using Windows 7 Enterprise 32bit.

This question isn’t a duplicate because I don’t know the path for opendir ("c:\\src\\"); it’s whatever directory the program is being executed from.

  • 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-06-09T17:26:38+00:00Added an answer on June 9, 2026 at 5:26 pm

    Here’s a sample code to do that:

    http://bytes.com/topic/c/answers/869208-list-files-directory

    In essence you utilize these APIs: FindFirstFile and FindNextFile

    For cross-platform solution see findfirst() and findnext()

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

Sidebar

Related Questions

My goal is to build an engine that takes the latest HL7 3.0 CDA
Ok guys, today's goal is to build a Turing machine simulator. For those that
My goal is to make a flash/as3 program that would pull multiple sets of
I am learning how to program and my goal is to build a simple
I'm working on a program that does OCR on a US business card and
I built a java program that consists of 2 files. The one that contains
I have been asked to build a rather simple form processor application that interacts
I want to write a program in Prolog that builds a list of all
My goal is to build a simple custom guard with Guard . The gem
Okay, so my goal is to build a easy to use protocol for sending

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.