473,320 Members | 1,804 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,320 software developers and data experts.

Random failures of _wfopen

PLS
Environment: Win32 code, Windows XP SP2 current on patches.

I am getting seemingly random failues of the line
FILE *tfh = _wfopen(line, L"w+tSTD, ccs=UTF-16LE");

errno is 13, No permissions, and after the _wfopen GetLastError returns
5, access denied.

The file name in "line" is correct, the working directory is correct,
the line has executed many times before (even with the same filename)
and at the point of failure the named file does not exist.

Oddly, if I breakpoint in the debugger after tfh is tested to be NULL
and set the next statement back to the open, it always works. If I
change the second argument to "w+tSTD, ccs=UTF-16LE" it also always
works.

Does anyone have any thoughts on what the problem is?

Jan 25 '08 #1
1 2167
PLS
In article <MP************************@msnews.microsoft.com >,
no****@nowhere.com says...
Environment: Win32 code, Windows XP SP2 current on patches.

I am getting seemingly random failues of the line
FILE *tfh = _wfopen(line, L"w+tSTD, ccs=UTF-16LE");

errno is 13, No permissions, and after the _wfopen GetLastError returns
5, access denied.

The file name in "line" is correct, the working directory is correct,
the line has executed many times before (even with the same filename)
and at the point of failure the named file does not exist.

Oddly, if I breakpoint in the debugger after tfh is tested to be NULL
and set the next statement back to the open, it always works. If I
change the second argument to "w+tSTD, ccs=UTF-16LE" it also always
works.

Does anyone have any thoughts on what the problem is?

Oops, that should be changing the second argument to
"w+tST, ccs=UTF-16LE" makes it always work. In other words, it's the
delete that causes the problem.

++PLS
Jan 25 '08 #2

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

Similar topics

10
by: Nicholas Geraldi | last post by:
Im looking for a decent random number generator. Im looking to make a large number of random numbers (100 or so, if not more) in a short period of time (as fast as possible). the function i was...
3
by: Timo Virkkala | last post by:
I tried to install Cheetah (0.9.15) and ran into trouble. When running the test suite, I get 61 failures and 57 errors. Most of the errors are "ImportError: No module named temp", with some...
10
by: Virus | last post by:
Ok well what I am trying to do is have 1.) the background color to change randomly with 5 different colors.(change on page load) 2,) 10 different quotes randomly fadeing in and out in random...
0
by: db2sysc | last post by:
All: I am trying to enable Performance Trace Class(30,8) IFCID(125) to collect RID failures and generate report with SQLACTIVITY REPORT WORKLOAD(SCAN). Is there any other better way to capture...
4
by: yf | last post by:
A KB article "http://support.microsoft.com/default.aspx?scid=kb;en-us;209599" tells that the maximum number of records that a table may hold if the PRIMARY key data type is set to AUTONUMBER is...
26
by: Jimmy | last post by:
ill have a database with 1 table and 3 fields: ID FIRSTNAME LASTNAME (the ID field will be the auto incrementing index) there might be 10 records in the DB, there might be 10,000. i...
6
by: Mike Langworthy | last post by:
i can not seem to get this code to work. someone please help using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program {
38
by: Andrea | last post by:
Hi, Anyone could me suggest how to create a function that generates a random string? The function should be: int _RandomString(char** str,int len); so, it takes an empty string str and it puts...
158
by: jacob navia | last post by:
1: It is not possible to check EVERY malloc result within complex software. 2: The reasonable solution (use a garbage collector) is not possible for whatever reasons. 3: A solution like the...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.