Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 13th, 2009, 04:57 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default tmpfile()

When tmpfile() creates a temporary file, how does it decide where to create it?

Is it always the same spot?
Is it following an environment variable?
Does it try different solutions, returning when one or the other succeeds?
 
Old April 21st, 2009, 04:15 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Waiting, waiting...
 
Old April 22nd, 2009, 12:12 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

With continued searching, I came across a Support.Microsoft.com page that stated that, though the literature would appear to indicate otherwise, tmpfile() always creates its file in the root folder of the current directory.

This was causing me the weirdest behavior. For security here where I work, C:\ is modifiable, but D:\ is read only.

The app I’m working on (which I inherited) creates a report by appending info to a tmpfile(). Sometimes this would fail, but sometimes it would succeed. It was apparently arbitrary, and the app gives no indication of what the problem is; it merely reports, “No report was created based on user input.”

Last edited by BrianWren; April 22nd, 2009 at 03:56 PM..









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.