473,487 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

file indexing in windows and unix

151 New Member
Hi,
I have written one program in C++ for file indexing and searching keyword which is working fine on unix. But on windows it may work differently reason being the /r/n at the end of line. While on unix it has /n only. How one program can be made intelligent enough to work same on different platforms.

Manish
Apr 28 '09 #1
4 1998
wastman
17 New Member
@Man4ish
You should not post questions here.this is insights part.
you can post articles here.go to the answers part.
Apr 28 '09 #2
Man4ish
151 New Member
Hi,
I have written one program in C++ for file indexing and searching keyword which is working fine on unix. But on windows it may work differently reason being the /r/n at the end of line. While on unix it has /n only. How one program can be made intelligent enough to work same on different platforms.

Manish
Apr 28 '09 #3
Banfa
9,065 Recognized Expert Moderator Expert
It rather depends for instance if you are only dealing with text files then you could open the files in text mode which converts the default OS line ending to a /n on reading and vice versa on writing.

Alternatively you could do something like treating /r as a space when your program sees it.

You need to find a logical way to handle /r that is going to continue to work if you encounter a /r in a file on a unix system.
Apr 28 '09 #4
Nepomuk
3,112 Recognized Expert Specialist
I found something that should help: Check this article, especially the chapter Proper #ifdef's when porting.

But wastman is absolutely right, this is the "insights" section and such questions belong in the "answers" section. I know, it can be confusing, but please try to post in the right place from now on.

Greetings,
Nepomuk
Apr 28 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3581
by: wtnt | last post by:
Hello. I've searched all over and haven't seen another thread with this problem. Please bear with me as I try to explain. thanks. :) I have some programs that need to be cross-platform...
4
2691
by: kalio80 | last post by:
Hi everyone I posted an enquiry earlier about using c++ code to convert text files between linux & widows. I ended up with this code: #include <iostream> #include <fstream> using namespace...
2
1743
by: Andrew Jocelyn | last post by:
Hi I get this error when I change something in the web.config file. When I build the VS projects and load the first web page the application runs fine. If I then make a save the web.config file...
3
9140
by: mrsmith | last post by:
I'm trying to do a file load with this statement: LOAD FROM "/directory/datafile.txt" OF ASC MODIFIED BY NULLINDCHAR=Y METHOD L (1 8, 13 20, 28 30, 39 89) NULL INDICATORS (4, 7, 8,0) INSERT...
0
4198
by: Chung Leong | last post by:
Here's a short tutorial on how to the OLE-DB extension to access Windows Indexing Service. Impress your office-mates with a powerful full-text search feature on your intranet. It's easier than you...
3
9523
by: Chung Leong | last post by:
Here's the rest of the tutorial I started earlier: Aside from text within a document, Indexing Service let you search on meta information stored in the files. For example, MusicArtist and...
1
6434
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting"...
7
3853
by: Marcus Kwok | last post by:
I am working on a program that reads and processes large text files (on the order of 32 MB, so not too huge), so I wanted to add a progress indicator so I can estimate when it will finish. I just...
38
5030
by: ted | last post by:
I have an old link that was widely distributed. I would now like to put a link on that old page that will go to a new page without displaying anything.
0
7105
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,...
0
7132
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,...
1
6846
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...
1
4870
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...
0
4564
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...
0
3076
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1381
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 ...
1
600
muto222
php
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.