Hi guys,
I suddenly think about this question. While we use fopen() to open a
file and then do reading and writing. Is fopen a blocked function?
Regards!
Bo 6 2415
Bo Yang wrote:
Hi guys,
I suddenly think about this question. While we use fopen() to open a
file and then do reading and writing. Is fopen a blocked function?
What is a blocked function?
--
Ian Collins.
Ian Collins :
Bo Yang wrote:
>Hi guys, I suddenly think about this question. While we use fopen() to open a file and then do reading and writing. Is fopen a blocked function?
What is a blocked function?
I mean if there is soem other process is now using the file, how the
fopen will act? It fails directly or just waiting there to the process
which uses the file release the file?
Regards!
Bo
Bo Yang wrote:
Ian Collins :
>Bo Yang wrote:
>>Hi guys, I suddenly think about this question. While we use fopen() to open a file and then do reading and writing. Is fopen a blocked function?
What is a blocked function?
I mean if there is soem other process is now using the file, how the
fopen will act? It fails directly or just waiting there to the process
which uses the file release the file?
The standard doesn't say, why should there be a problem with more than
one process opening a file?
There may be platform dependent error returns if a file is exclusive.
--
Ian Collins.
Ian Collins :
Bo Yang wrote:
>Ian Collins :
>>Bo Yang wrote: Hi guys, I suddenly think about this question. While we use fopen() to open a file and then do reading and writing. Is fopen a blocked function?
What is a blocked function?
I mean if there is soem other process is now using the file, how the fopen will act? It fails directly or just waiting there to the process which uses the file release the file?
The standard doesn't say, why should there be a problem with more than
one process opening a file?
There may be platform dependent error returns if a file is exclusive.
So, if there are many process want to do fopen("file","a"); . Are they
all success? Or there are some will failed?
Bo Yang wrote:
Ian Collins :
>Bo Yang wrote:
>>Ian Collins : Bo Yang wrote: Hi guys, I suddenly think about this question. While we use fopen() to open a file and then do reading and writing. Is fopen a blocked function? > What is a blocked function?
I mean if there is soem other process is now using the file, how the fopen will act? It fails directly or just waiting there to the process which uses the file release the file?
The standard doesn't say, why should there be a problem with more than one process opening a file?
There may be platform dependent error returns if a file is exclusive.
So, if there are many process want to do fopen("file","a"); . Are they
all success? Or there are some will failed?
That depends on the platform and system specific things like file locks.
--
Ian Collins.
Bo Yang wrote:
I mean if there is soem other process is now using the file, how the
fopen will act? It fails directly or just waiting there to the
process which uses the file release the file?
As stated by the others, the Standard doesn't specify. Generally, they
will all be able to open. That's why most platforms provide some sort
of file-locking ability.
Brian This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jay Vinton |
last post by:
I recently posted my first .aspx effort and am getting calls from users
saying the page is being blocked and they can't view it. They got a hyperlink
in an e-mail (see below). Most have been...
|
by: laurenq uantrell |
last post by:
In master.dbo.sysprocesses I can filter for blocked users (Blocked >0)
and I can create a self join(ON SPID = Blocked) to see what user
Loginame is causing the block. In the column I can see the...
|
by: git_cs |
last post by:
Hey, guys and gals
Somedays ago, I had asked for the DES algorithm in C language.
Although I have written the algorthim in C myself, I am facing a
peculiar problem, which I hope some of u guys and...
|
by: Blue |
last post by:
Hi ,
Can any one please let me explain me the diffrences between "open"/
"fopen" or "read"/"fread" or "write/fwrite".
I know that "open" /"read" / "write" are system calls and "fopen"...
|
by: pjlsr |
last post by:
It's close to twenty years since I used the C language and at that time
I was doing only floating point computational work, nothing with
strings or reading files. I tried to use fopen in the...
|
by: Dr. J |
last post by:
How to terminate a blocked thread?
In my form's "load" I launch a TCP listening thread that stays in an
infinite loop waiting for incoming TCP packets. In this form's "closing" I
try to...
|
by: Julia |
last post by:
Hi, there,
I am trying to append a binary file by using:
FILE *strean;
stream = fopen( "c:\temp.dat", "ba+" ));
Is there a way that I can check if the file exists or not before
fopen,...
|
by: dd |
last post by:
I have a scenario where my popups are being blocked
by IE6+ and Firefox. The problem is that although the
popup is a direct result of the user clicking on the link
(meaning that they WANT the...
|
by: Brian |
last post by:
Hi
I have a problem in opening url using 'file'.
I searched many other discussion groups and tried suggestions,
but could not resolve this problem.
e.g
<?php
$myfile =...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
|
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...
|
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...
| |