• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

How to store file in a name.sim directory?

I have a problem.
AssignFile(f,filename);
        Rewrite(f);
i get an error that it is invalid filename.
And filename is pics/new.sim/filename
It is very important for me that the middle dir is called new.sim
How can i do this then?
Please help, i m desperate.
0
SluX_mon
Asked:
SluX_mon
1 Solution
 
kretzschmarCommented:
did the directory exist?
(your filepath is relative to the current dir)
0
 
geobulCommented:
Shouldn't it  be pics\new.sim\filename instead?
0
 
Ivanov_GCommented:

   FileName := 'C:\pics\new.sin\filename'
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
mokuleCommented:
- create full desired file name with path, using ParamStr(0) if needed
 - ExtractPathName
 - DirectoryExists - check directory existance
 - ForceDirectories if directory doesn't exists
0
 
SluX_monAuthor Commented:
Sorry guys, i cant give you points. As soon as i posted i realized that not all .sim directories were created(there are over a 50 of those).
Thx anyway.
I would  be happy if moderator closes this question.
0
 
DissasterCommented:
I think you should give the points to kretzschmar, after all he gave the right answer and you posted that you had already found the answer 6 hours after he posted his answer.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now