SUSE :: Writing To Log File Affecting Performance

Apr 8, 2010

I have 3 c files(one of them forks out 5 instances) all writing to one log file. Now to avoid the confusion of opening and closing in each application or instance and running into a situation of not having closed a file I decided to open and close the log file inside the log function for each write.

So what I do currently is fopen, flock, fwrite, unlock, fclose for each write. All the log messages from all the files get written fine and there are no errors but I see a performance hit. The applications talk to each other using SHM(shared memory). So when I try to set a timer and check number of messages lets say I get X messages. Each time I remove or add a log call the number of messages changes. When it is a 1 sec or 5 sec timer it doesnt make a very big diff..few hundreds but when I check it over a longer period..every log call added decreases 1000 messages in count. So I want to know what is an efficient way of implementing the custom log across the application.

View 6 Replies


SUSE :: Input Method For Japanese Writing In 11.2 - Like Microsoft IME ?

Mar 17, 2010

Anyone knows a good input method for japanese writing in openSuSE 11.2 ? I tried to find something that works well (like microsoft IME) but unfortunately couldn't find anything...

View 3 Replies View Related

Programming :: How To Write Using Fwrite Without Affecting Existing Content Of File?

Oct 30, 2010

How can I write to a file multiple times using fwrite without affecting the previous writes?The method shown below accepts a file name, buffer and offset. The method opens the file in reading/writing mode and writes the content of the buffer at offset.

View 1 Replies View Related

Software :: Writing An ISO File For Cd Audio From A Cue And Wave File?

Nov 30, 2008

I am running Intrepid Ibex 64-bit, and I have recently ripped a cd with EAC on one of my windows boxes, and it produced a cue sheet and one single wave file for the entire cd. My question is this, is it possible to take the wave file, burn an ISO image that acts exactly like the original cd? In other words, take the single wave file, using the cue sheet splitting it back into it's individual tracks, and then reading the subsequent ISO image from a program like Sound Juicer, so it can write all the metadata and convert it with my own preferences. I know this is a very strange predicament, but it's one that would save me a world of hassle.

View 5 Replies View Related

Red Hat / Fedora :: Writing To Log File In C?

Apr 1, 2010

I am trying to write into a single log file from 3 different applications in C. In one of the applications I am forking out 5 instances. I would like to know what is the best way to open and close the log file in which i want to write from these applications. Should I open and close it at the start and end of each application or is it ok performance wise if i open and close it inside the log function which will be called for every write.

View 6 Replies View Related

General :: Writing To A File Using Sed?

Mar 3, 2011

i am having a the following line in a file

<property name="connection.password"></property>

i have to give password in this line, like this

<property name="connection.password">XXXXXX</property>

Is this possible to acheive this using sed command

Beause i have to do this for n number files. so if i have option in sed for this the i will be doing this using script.

View 7 Replies View Related

Server :: NFS Large File Copies Fail - Error Writing To File: Input/output Error?

Jun 27, 2009

I recently upgraded my file/media server to Fedora 11. After doing so, I can no longer copy large files to the server. The files begin to transfer, but typically after about 1gb of the file has transferred, the transfer stalls and ultimately fails with the message:

"Error writing to file: Input/output error"

I've run out of ideas as to what could cause this problem. I have tried the following:

1. Different NFS versions: NFS3 and NFS4
2. Tried copying the files to different physical drives on the server.
3. Tried copying the files from different physical drives on the client.
4. Tried different rsize and wsize block sizes when mounting the NFS share
5. Tried copying the files via a different protocol. SSH in this case. The file transfers are always successful when I use SSH.

Regardless of what I do, the result is the same. The file transfers always fail after approximately 1gb.

Some other notes.

1. Both the client and the server are running Fedora 11 kernel

I am out of ideas. Has anyone else experienced something similar?

View 13 Replies View Related

General :: Writing Array Into File?

May 3, 2010

How can we write arrayValues in file? Lets say arrayName=(1 2 3 4 5) Now if i want to write these arrayValues into file

In first line in file :1
In second line in file :2
In third line in file :3
In fourth line in file :4
In fifth line in file :5

View 3 Replies View Related

General :: Writing Text To A File?

Mar 18, 2010

I am using Grass GIS

I have written a script which outputs a list of numbers to a file

code snippet:

r.stats -1 fs=, input=Bones_AVE > /home/gary/AVE_monte_carlo/rstats_AVE$i.csv

so this makes acsv file with one column. I want to run it again but rather than outputing to a new csv i want to add it to this one as the next column. For this example there will be 100 rows per column.

the 1st one will make the file

[grassGIS code]> /home/gary/AVE_monte_carlo/rstats_AVE.csv
add ',' after each value
the next one
[grassGIS code] open file /home/gary/AVE_monte_carlo/rstats_AVE.csv


View 1 Replies View Related

Programming :: Writing File In Perl/cgi?

Apr 10, 2010

I'm not able to write to a file using my perl cgi script which is as fallows:

#!/usr/bin/perl -w
use strict;
print "Content-type: text/html


View 4 Replies View Related

General :: RPM - Writing Script In Specific File

Apr 11, 2011

Is it possible to write ksh script in the spec file? The target is after I perform
rpm -i my_rpm.rpm
According to the spec file, ksh script will do some installation & configuration. For example run other script and edit some files.

View 1 Replies View Related

Ubuntu :: Avoid Users Writing On The Same File?

Feb 27, 2011

Is it possible to forbid that more then one user open the same file in rw mode? In windows when you open a file that another user is using, there's ad advise and you have to open it in read only mode

I installed ubuntu 10.04 desktop edition on 3 pc (there is not a server-client architecture). I installed samba.(and smbfs)

put the strings:
comment = ...
path = /...
guest ok = yes
read only = no
create mask = 0777
directory mask =0777

Computers that access to that directory do (on boot, with root privileges)
mount -t smbfs -o username="user",password="pass" // /mnt/cartelladimontaggio

But if two users access to the same file, both are authorized writing on it! So changes made by one are lost when the other save.

View 4 Replies View Related

General :: Detect If A Program Is Writing To A File?

Mar 3, 2009

I have custom software that writes to a sensitive large file when the user does something. I would like to make backup copies of The file that gets written to, but if I make a gzip of the file at the same time someone is changing something, it will corrupt the backup because some of the data will be missing, as its backed up during being written to.

a) Is there a way to detect if a file is currently being accessed/written to?
That way if its currently being accessed, I can just make the script wait until its done and then finally back it up.

b) Instead of backing up the large file while it has potential to get written to, would it be better to make a copy of the file first, then gzip the copy? This idea comes from the fact that gzipping the original takes 5-10 seconds, whereas making a copy only takes 1-2 seconds. The less time, the less chance of corruption.

c) Is there anyway to freeze a program or a file to stop it from being written to for an amount of time?

With a, b, and c together. The best solution I have to my problem would be a script that first detects rather the file is being accessed. If not, it would then freeze the file/program and then make a quick copy of it. Once the copy is created, it will unfreeze the original file/program and then go about gzipping the copy.

View 3 Replies View Related

Programming :: [C++] Writing Double Value To A Text File?

Jun 3, 2011

int main ()


View 9 Replies View Related

General :: RPM + Writing Script In The Spec File?

Feb 23, 2011

is it possible to write ksh script in the spec file? the target is after I perform rpm -i my_rpm.rpm according to the spec file , ksh script will do some installation & configuration for example run other script and edit some files

View 5 Replies View Related

Ubuntu Installation :: Writing SBM File To Floppy With Ntrawrite?

Oct 24, 2010

i am trying to create a floppy boot disk as my computer doesnt support booting from cd. I have downloaded ntrawrite and placed it in a file with the sbm file and followed these instructions [URL] which i found here.

when i type in the command i get the response "ntawrite is not recognised as an internal or external command"

Is the problem that im not opening the cmd in the right directory? I dont know how to change this.

View 1 Replies View Related

Programming :: Reading And Writing White Spaces To A File?

Dec 2, 2010

I am trying to read a file character wise and trying to write the same character to another file. In this process, I unable to read and write white spaces successfully to the new file. The script reads the white spaces but while writing the white space is lost. The section of the code, is given below. Please advice how can i read and retain the white space while writing to a new file.


if [ -s f_test.txt ] && [ -f f_test.txt ]; then
echo "File Exists !!"
while read -n1 char; do


View 2 Replies View Related

Software :: SHA1-Hashing Differs When Writing To A File?

Mar 9, 2011

it is about the program sha1sum to create SHA1-hashes. As you probably know, SHA1-Hashes do have the length 20 byte. So when I just type:

sha1sum myfile

it produces an output of

(some20byte) myfile

just as it should. Now I want to store the 20byte hash in another file, I use this command:

sha1sum myfile | awk "{print $1}" >> myhash

Unfortunately I'm not familiar with awk, but this should cut off the end of the sha1sum output, which is the name of the file again. The problem here is: The newly created file myhash has the size 41 bytes, and printing it out I can see that it is not the original hash (I wrote a little program to print it bytewise).

View 4 Replies View Related

Programming :: Know Which File Under The Folder Is Being Opened / Created For Writing?

Apr 23, 2010

My program need to monitor the foler to know which file under the folder is being opened/created for writing. I add the folder into watch list using inotify_add_watch, when a file -- say 'AA' -- is created, I'll get the event through read api call. But the inotify_event only have file name 'AA' and a event mask. these parameters can't help me to know how the 'AA' is created/openned. So I have to scan the /proc folder to get to know how is 'AA' created/openned. I don't think this is a efficient way, especially if there are lots of files are openned/created in a short time span.

View 3 Replies View Related

Programming :: Zip A Variable With PERL Without Reading Or Writing A File?

Jun 20, 2010

There is the Archive::Zip I think I can use with Perl 5.10 but I don't know how. I don't want to read or write any files, just zip something in memory, with best compression, like

$text = "this is a test";
$zippedtext = &Zip($text);
sub Zip {


I guess it's only a few lines.

View 3 Replies View Related

Programming :: Perl - Writing To File - Keep Open Or Only During Write?

May 24, 2011

i am working on this thread: [URL] if it is better to open a file every time i need to write to it or should i keep a file open the whole time and when i am done with the script, close it and sendmail it out?

Or i just thought of this: i could keep concatenating to a string and just sendmail when done.

View 2 Replies View Related

Ubuntu :: Ondemand Vs Performance - Increases The Clock Speed To Performance When The CPU Is Under Load

Jul 31, 2010

I just wanted to know if having my laptop set to ondemand, will this affect performance in any way? I realize it increases the clock speed to performance when the CPU is under load, but does the time it take to go from ondemand to performance affect speed? Will there be any noticeable difference between the two setups? I have a dual core intel at 2.2GHz when in performance. When ondemand is set with no load it downclocks to 800Mhz.

View 7 Replies View Related

General :: Writing A Script To Parse Information From A Text File?

Apr 29, 2011

Go to a specified directory and open a log file and parse out specific information and dump it into another text file.

View 4 Replies View Related

Hardware :: How To Start Writing Code For File Transfer In Bluetooth

Mar 22, 2011

I have installed bluez libs,utils and all the requirements for bluetooth communication. And i am able to scan other bluetooth devices around. Will somebody please suggest me on how to start writing code for file transfer in bluetooth. Or can I get any packages online to do that for me. I am using RHEL5 and x86_32.

View 6 Replies View Related

Software :: MySQL Error: Writing File '/tmp/MYrZo6Qh' (Errcode: 28)?

Nov 15, 2010

No, the disk is not full and there are only a few files in tmp directory, but some MySQL queries return this error:

Error writing file '/tmp/MYrZo6Qh' (Errcode: 28)

Something strange:

PHP Code:

select from table where c1='1' and c2='1' and c3='1' 

returns Error 28 but

PHP Code:select from table where c1='1' and c2='1' and c3='0' 

View 6 Replies View Related

Programming :: Writing Files With Python Produces Blank 0KB File?

Jun 22, 2010

I am working on a little project in python. i have produced this prototype

# -*- coding: iso-8859-1 -*-
#DocC documentation prototype


View 2 Replies View Related

Fedora :: CIFS Bad Performance On File Creation?

Sep 28, 2010

I am experiencing poor performance when using cifs share.Such poor performance occur only in the creation of files on the share but not in the rewrite.This is what i do:

#mount -t cifs -o guest,user=<user> // /mnt/winshare/
# time dd if=/dev/zero of=/mnt/winshare/b.avi bs=1024 count=10000


View 6 Replies View Related

Fedora Servers :: File Change Notification When Writing To Network Drive

Sep 8, 2009

I have a relatively common problem, but I don't seem to identify it's source. I have a SAMBA server on my LAN to which there are mapped a few shares as network drives in windows xp (as Y: ) and mounted as CIFS in linux [as /y]. The problem is that every time I save a file [either windows xp or linux] on the mapped drive / mounted folder, our IDEs alert us that the file changes right after the save. I am running SAMBA 3.3.2.

View 1 Replies View Related

General :: Removing Write Permission Does Not Prevent Root From Writing To File

Feb 3, 2010

I just noticed on my Ubuntu machine (ext3 filesystem) that removing write permissions from a file does not keep root from writing to it. Is this a general rule of UNIX file permissions? Or specific to Ubuntu? Or a misconfiguration on my machine? Writing to the file fails (as expected) if I do this from my normal user account.Is this normal behavior?Is there a way to prevent root from accidentally writing to a file (Preferably using normal filesystem mechanisms, not AppArmor, etc.)

I understand that root has total control over the system and can, eg, change the permissions on any file.My question is whether currently set permissions are enforced on code running as root. The idea is the root user preventing her/himself from accidentally writing to a file. also understand that one should not be logged in as root for normal operations.

View 4 Replies View Related

Ubuntu :: Upgrade Existing Directly - Install Downloaded ISO Without Writing The ISO File In A CD?

Nov 5, 2010

I'm using ubuntu 8.10 which is already installed. Recently I have downloaded ISO file of ubuntu 10.04. Is there any way to install that ISO file i've downloaded without writing the ISO file in a CD?

View 4 Replies View Related

Copyrights 2005-15, All rights reserved