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 8092169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:13:47+00:00 2026-06-05T20:13:47+00:00

In my current project, I am writing code generator. The interface would be Command

  • 0

In my current project, I am writing code generator. The interface would be Command line.

In command line argument, user specifies specification files and destination folder, Which guides the code generator to generate files in specific destination folder.

For instance, my command line argument would be

VocArchSpec.text NetworkSpec.text ./src/fr/inria/arles/pankesh/gen ./src/fr/inria/arles/pankesh/gen/logic ./src/fr/inria/arles/pankesh/gen/sim/device ./src/fr/inria/arles/pankesh/gen/util

In the above command, 1 and 2 are specification and others are path of destination. This path is used by code generator. The code generator generates several java files in the specified destination folder.

But, my problem is I am getting following error :

java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createNewFile(File.java:883)

===============> I use following code to generate files.

new File(GlobalVariable.utilDirPath).mkdir(); // Assume that I set the value GlobalVariable.utilDirPath variable through command line arguments. 
file = new File(GlobalVariable.utilDirPath + "/" + unit.getName());
file.createNewFile();
FileWriter writer = new FileWriter(file);
writer.write(content);
writer.flush();
Writer.close();
  • 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-05T20:13:49+00:00Added an answer on June 5, 2026 at 8:13 pm

    One way to get this exception is when the path (folder) where the file is to be created does not exist. Your code needs to make sure that the folders specified exist.

    For an easy way to create these, look into File.mkdirs().

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

Sidebar

Related Questions

My current project involves writing Perl code inside a Solaris VMWare appliance (hosted on
My team's current project involves re-writing retrieval libraries in JavaScript. We are basically looking
In a project I'm writing code for, I have a void pointer, implementation, which
I am working on a solo project, writing all code myself so no collaboration
Converting my current code project to TDD, I've noticed something. class Foo { public
My current project is broken down into 3 parts: Website, Desktop Client, and a
Our current project has ran into a circular dependency issue. Our business logic assembly
My current project involves using LDAP (Active Directory) and I'm using issue tracking for
On my current project, which is a delivery system, I have a list of
for my current project i need to consume messages from many destinations (from hundreds

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.