Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 03-25-2001, 08:40 AM   #1
LQ Newbie
Registered: Mar 2001
Posts: 1

Rep: Reputation: 0

I've been having some problems writing files using C++ in Linux(g++ compiler).

I'm trying to write a program in both Windows and Linux to write some data to a file and prevent it from being shared whilst this is happening. In Windows i've been using the following,"file3.txt",ios::out,filebuf::no_share);

When i compile this in Linux i get a parse error after filebuf. Is there a way to deny sharing in C++?
If i was doing this in C i would use flock() but it takes a filedescriptor not a object. I need to write this in C++.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
sharing files arell12 Linux - Newbie 1 08-03-2005 07:36 PM
Sharing Files landuchi Linux - General 4 06-23-2005 04:56 AM
mandrake 10.1 sharing files and internet sharing xfiles_arram Linux - Networking 0 05-21-2005 03:22 PM
Sharing files with others Cooner Programming 1 09-23-2004 05:28 PM
sharing files ridha Linux - Networking 1 02-01-2003 11:18 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:37 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration