473,626 Members | 3,952 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C program works on W98 but not new WXP machine

Hi,

On my previous Windows 98 machine, I wrote a simple C program that takes
two text files as input, performs some calculations, then produces a
text file that contains the results. It worked fine on that machine.
Recently, however, I obtained a new Windows XP machine, and the program
is not working correctly on my new computer computer. On the new XP
machine, I'm running the program in the DOS window, as before, and the
program does execute and produce an output file, however the file is
empty.
I tried the following, but the results were unchanged:

1. Compiling it on the new machine

2. Changing the location of the input files, and thus the directory
path, so that there were no spaces in the path, i.e., the default path
contained "documents and settings." (The program, itself, is in a
folder that is accessible from any location, and I have used other
programs within this same folder with associated input files in other
locations and it works fine, so that isn't the problem)

3. Logging in as administrator to see if there was a permission problem

The program was created in Borland C++ 5.02.

Any ideas? Is there something obvious that I'm overlooking?

Thanks for your time.

DM
Nov 14 '05 #1
4 1482
Denise Mills wrote:
Hi,

On my previous Windows 98 machine, I wrote a simple C program that takes
two text files as input, performs some calculations, then produces a
text file that contains the results. It worked fine on that machine.
Recently, however, I obtained a new Windows XP machine, and the program
is not working correctly on my new computer computer. On the new XP
machine, I'm running the program in the DOS window, as before, and the
program does execute and produce an output file, however the file is empty.
I tried the following, but the results were unchanged:

1. Compiling it on the new machine

2. Changing the location of the input files, and thus the directory
path, so that there were no spaces in the path, i.e., the default path
contained "documents and settings." (The program, itself, is in a
folder that is accessible from any location, and I have used other
programs within this same folder with associated input files in other
locations and it works fine, so that isn't the problem)

3. Logging in as administrator to see if there was a permission problem

The program was created in Borland C++ 5.02.
Are you sure you use the compiler in C mode?
Any ideas? Is there something obvious that I'm overlooking?

Thanks for your time.


Your program seems to invoke undefined behavior, implementation-defined
behavior, or perhaps you have triggered a compiler bug (unlikely).

Please simplify the program to the smallest version that you'd expect to
work but doesn't. If this contains Windows-specific code, show it in a
windows-dedicated newsgroup. If it is (near-)standard C code, show it
here to have it scrutinized.

Best regards,

Sidney

Nov 14 '05 #2
"Denise Mills" <dm****@d.umn.e du> wrote in message
news:bv******** **@lenny.tc.umn .edu...
Hi,

On my previous Windows 98 machine, I wrote a simple C program that takes
two text files as input, performs some calculations, then produces a
text file that contains the results. It worked fine on that machine.
Recently, however, I obtained a new Windows XP machine, and the program
is not working correctly on my new computer computer. On the new XP
machine, I'm running the program in the DOS window, as before, and the
program does execute and produce an output file, however the file is
empty.


The answer is simple. You know that Windows XP is the best thing since
sliced bread, right? And in its infinite wisdom, when the system loads
your program, it recognizes that it had been built with Borland C++ and
makes it misbehave like everything not supplied from Microsoft.

I'm just kidding, of course. Without looking at your source, there is no
other way to tell. Most likely you used void main() or some other instance
of undefined behaviour that "seemed to work" on one (version of) an OS
nut not on another. Share your code with the group and we'll see.

Peter
Nov 14 '05 #3
Denise Mills wrote:
machine, I'm running the program in the DOS window, as before, and the
program does execute and produce an output file, however the file is
empty.


This is a long shot, but look at your code and make sure you are closing
the file after you're done writing to it. Blank files sometimes means that
output files are not committed to disk (ie, you write to the file, but the
contents remain on cache because the changes have not been committed).

Otherwise, as others have said, post your code.

--
gabriel
Nov 14 '05 #4
On Tue, 3 Feb 2004, Denise Mills wrote:
Hi,

On my previous Windows 98 machine, I wrote a simple C program that takes
two text files as input, performs some calculations, then produces a
text file that contains the results. It worked fine on that machine.
Recently, however, I obtained a new Windows XP machine, and the program
is not working correctly on my new computer computer. On the new XP
machine, I'm running the program in the DOS window, as before, and the
program does execute and produce an output file, however the file is
empty.
The most likely problem is that your program APPEARED to work on Windows
98. It is not uncommon for new programmers to create programs with
undefined behaviour. Undefined behaviour means that anything can happen.
For example, on Windows 98 the program does what is expected. On Windows
XP it fails to create a file.
I tried the following, but the results were unchanged:

1. Compiling it on the new machine
Highly doubtful this would make a difference.
2. Changing the location of the input files, and thus the directory
path, so that there were no spaces in the path, i.e., the default path
contained "documents and settings." (The program, itself, is in a
folder that is accessible from any location, and I have used other
programs within this same folder with associated input files in other
locations and it works fine, so that isn't the problem)
Good guess. This is a common bug in an application.
3. Logging in as administrator to see if there was a permission problem
Another good guess.
The program was created in Borland C++ 5.02.

Any ideas? Is there something obvious that I'm overlooking?


I'm going to guess that you'll have to look at the code and REALLY
understand what it is doing. Look at the comp.lang.c FAQ to see if there
is anything in there to indicate what you might be doing wrong. The FAQ is
at www.eskimo.com/~scs/C-faq/top.html.

--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to vi************@ whitehouse.gov
Nov 14 '05 #5

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

Similar topics

11
8510
by: anuradha.k.r | last post by:
hi, i am writing a socket program in python,both client side and server side.I've written the client side which is working perfectly fine(checked it against server program written in C).but as for my server program written in python it simply hangs.it does not show any error also.I've tried sample programs available .I don understand what the reason is as i am quite new to it. here is teh server side program: ///////////////////////
3
1278
by: Radioflyer651 | last post by:
I've been working on a problem which has me totally confused. My application is checking a collection of objects to see if they have a difference in one of it's properties. If it does, it's including a list if different properties in its print-out. If not, it just prints the property value of the first item. Now here's my problem. When I'm running it in the IDE, everything works the way it should work. (Both in release mode and...
8
1681
by: G Patel | last post by:
I wrote the following program to remove C89 type comments from stdin and send it to stdout (as per exercise in K&R2) and it works but I was hoping more experienced programmer would critique the layout/style/etc. Any comments will be helpful. Thank you. /* **************************************************** C89/90 COMMENT REMOVER
0
1337
by: joeted | last post by:
Hi, I am using system.diagnostic.process with the intention of running a program to communicate with a unix box: The program is "PuTTY", running from a batch script. I know it works because if i manually trigger the batch, the results can be seen on the unix side. Running the batch script from an .aspx page however makes the process
29
3936
by: tele-commuter | last post by:
Hi folks, I want to understand how exactly is an image(compiled c code and loaded into memory) stored in memory. What exactly is a linker script? I work with a lot of c code on a daily basis but I really don't understand :
3
4123
by: sir.linying | last post by:
My php script is to call perl scipt which makes use of Spreadsheet::ParseExcel module to parse Excel file. I am able to launch php script from command line so that perl script can run and properly parse Excel file. However, when I put php script on server side and then launch php through client request, perl program can't run. Anyone has any suggestion re how to fix this problem? Thanks a lot, -Ying
5
2625
by: Igor | last post by:
Hi! We built VB6 application to work with Reporting Services server. To connect to reporting server has been created a special assembly with .NET VS2003. While we execute our program on local machine, every thing works. But when we put the whole program on network drive, the VB6 program could not create required object from .NET assembly. Nothing we done were not useful to help to solve the problem. Does anybody have idea?
8
960
by: id10t error | last post by:
Hi, I am sorry that my description is not better but it is hard to think of one for this problem. I have a program on the user computer and I need to only let them have one instants of this program open at one time. Is there a way to check to see if the program in already running and not let them open it? Thank you in advance for your help.
6
1875
by: John O'Flaherty | last post by:
Hello. I have an ms acess database that I use to track my mp3 files. I have included code that lets me select and play files by invoking an mp3 player (Winamp). This is done by using visual basic command "shell c:\winamp\winamp.exe blah-blah.mp3". It works nicely. I can use this database from a laptop, either by copying the .mdb file to the laptop or by clicking a shortcut that points to the .mdb file on the main machine. The file play...
0
8266
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
8638
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8365
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
8505
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6125
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
5574
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4092
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...
1
2626
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.