473,781 Members | 2,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to manage temporary files in C ?

Hi all,

i'd like to use several temporary files in my current C-project. I already
tried to use "mkstemp" and "tempnam" functions. The problem is that my
compiler warned me about the use of "tempnam" which seems to be dangerous...
could someone help me with giving me pieces of advice concerning the use of
temporary files in C ?

Thanks a lot
Duff
Nov 14 '05 #1
3 1794

"Duff" <se*******@wana doo.fr> wrote in message
news:c0******** **@news-reader4.wanadoo .fr...
Hi all,

i'd like to use several temporary files in my current C-project. I already
tried to use "mkstemp" and "tempnam" functions. The problem is that my
compiler warned me about the use of "tempnam" which seems to be dangerous...

I don't know about 'dangerous', but the 'problem' is that neither
of 'mkstemp' or 'tempnam' are standard C functions, so not topical
here.
could someone help me with giving me pieces of advice concerning the use of temporary files in C ?


See the standard functions 'tmpfile()' and 'tmpnam()', declared by <stdio.h>

If you get stuck, post your code and ask specific questions.

-Mike
Nov 14 '05 #2
Thank you Mike...
I'll see and post again if needed.
Nov 14 '05 #3
ok, no problem using "tmpfile()" ... thanks.
Nov 14 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
10212
by: phpninja | last post by:
Greetings, I was wondering if it is possible to delete someone's temporary internet files with javascript? Basically I'm am using a PDF module called HTML_ToPDF. The pdf module takes some output based on queries and creates a pdf, and it works great. My problem is, if i make a change to the data in the database, then rerun that exact pdf routine (done by clicking a form button that reposts the data), the pdf that is refreshed in the...
5
16834
by: Rosa | last post by:
Hi, I'm trying to clear the TIF on Windows XP programmatically with the below code. This code works fine on any folder but the TIF. For some reason the atEnd() statements always defaults to true and no files are deleted in the folder. The peculiarity of this issue is that the files/subfolders cannot be seen through the windows explorer either. I can only access/delete them through a command shell. Any ideas?
3
3908
by: Rajiv Das | last post by:
VS 2003, XP SP2 ------------------------------------------------------------ DirectoryInfo temporary = new DirectoryInfo( Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)); FileInfo files = temporary.GetFiles(); foreach(FileInfo fi in files) { Console.WriteLine(fi.FullName); }
2
3144
by: Kiko + | last post by:
Hi, I've been getting this error: Server Error in '/applicationname' Application. ---------------------------------------------------------------------------- ---- Failed to create temporary files directory
5
4955
by: localhost | last post by:
I want to determine within my code-behind only the location of the current tem directory for ym ASP.NET files. For example, the latest web app build on my system shows: "c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\testapp\97e6075d\ca93f565\assembly\dl2\d5f616ee\9e1410d4_0348c401" I know it is dynamic, but I want to determine what the current directory is in-code.
4
2346
by: Nicolás Castagnet | last post by:
Hi, I write this post because I notice a strange behavior related with "Temporary Internet Files" and maybe some of you can help me to understand it. I am working in a web application with ASP.NET. Recently, I group of user have problems with it because the values of the sessions were not stored correctly (the application save the username in a login page, then other page try to get it and the result was always ""). We restart the web...
5
3866
by: Bas Hendriks | last post by:
Has anyone any idea how asp.net find it's files back after compiling them to the temporary asp.net directory? I found on numerous webpages that the directorynames are chosen random but cannot find how asp.net find's it's compiled files when asking for the same webpage which was complied before. -- Bas Hendriks Technical Specialist PinkRoccade
5
3428
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok afterwards. I did no development for a couple of weeks, came back and I kept receiving Access Denied to Microsoft.Net\Temporary Internet Files\... Access is Denied. ASPNET had full access to that file and all subfolders. The website I am...
3
8650
by: teo | last post by:
I have two .aspx pages they use two different Global.asax files when I "Publish" the first .aspx page, its Global.asax is transformed in App_global.asax.compiled App_global.asax.dll to put in the Bin folder
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10306
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5373
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3632
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.