473,387 Members | 1,897 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

creating directories issues

momotaro
357 100+
Hi,
I have a function that handle directories creation here it is:
Expand|Select|Wrap|Line Numbers
  1. public File createDirectory(String name)
  2.     {
  3.         File directory = new File(name);
  4.  
  5.         if(!FileOrDirectoryExists(name)) 
  6.             directory.mkdir();
  7.         return directory;
  8.     }
but when I pass a string to it in this format: pkg\\links
it is supposed to create a folder named pkg AND a sub-folder
named links no?

the behavior is that it creates pkg but not links until I run the app a second time.
Jul 29 '11 #1
1 1360
momotaro
357 100+
never mind just replace mkdir by mkdirs :) thx anyway
Jul 29 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: dave | last post by:
I am using vs.net 2003 on windows xp. After clicking on a project within my solution and selecting create new folder vs.net responds back with , the "directory already exists". If i look at the...
5
by: Patrik | last post by:
I know how to read/write files using iostram, but I can't figure out how to create a directory. Say I wan't to create a directory called "/home/work/outfiles", how do I do that? I'm running red hat...
6
by: Eran Kampf | last post by:
I am trying to dynamically create directories in my ASP.NET application (I am using Server.MapPath("/")+"test" as the folder) and I am getting a DirectoryNotFoundException saying "Could not find a...
1
by: Senthil | last post by:
Con is the file name for a reserved device name(i think it is for console). So you cannot create a file with name 'con'. choose some other name senthil >-----Original Message----- >Hi...
3
by: Stelrad Doulton | last post by:
Hi, I am having a strange problem on IIS 6.0. I am trying to create directories under a virtual directory on the fly to which I will upload files and retrieve these files later. I am having 2...
3
by: tkal2k | last post by:
i want to create a directory in a certain subfolder, but here's the catch each entry in my database is assigned an autonumber i want to be able to create a new directory when i press a button...
4
by: Stimp | last post by:
When a user registers with my site, I create a separate folder for them (for uploading photos, etc). The code for this has been working fine for 1 year, but over the past 2 weeks it has been...
4
by: samreen | last post by:
i want to create and access directories using C functions.............could u please help me out regarding this....
0
by: srinivasan srinivas | last post by:
Can someone tell me is there any module available to create directories?? I tried os, tempfile. I was facing some issues with os.mkdir(). Themode setting was not proper with this method. I...
0
by: david wright | last post by:
--- On Fri, 9/5/08, srinivasan srinivas <sri_annauni@yahoo.co.inwrote: this appears to be working, what where you expecting? "An upper case "S" means there is no executable permission, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.