write

Write/Read plist file iPhone

Hi I have plist in my iphone app and I want to read and write an integer from my single to and form it. I have this to read it: scoreData *score = [scoreData sharedData]; filePath = @"stats.plist"; NSMutableDictionary* plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath]; score.highScore = [plistDict object...

C program: How to read from one file and write into another? Indexing

I am trying to write a program that will read the existing records of a file and then index them in another file. The records are stored in the file named "players.bin" which is CSV format each record contains (username,lastname,firstname,numwins,numlosses,numties and i want to index them in a new file named "players.idx". However the ...

socket never accept bytes to write

Hi, I'm trying to write a client. I am able to open a socket to the server and the server acknowledges the connection, but for some reason, the write stream is never ready to accept data, i.e. it seems to always be blocked. What am I doing wrong? I'm new to socket programming, so it might be something in the wrong place, but here's w...

PThread RWLock Deadlocking with Recursive Locks

I've been working on a small sand-boxed example to help me figure out how to use rwlocks. Everything seems fairly straightforward, however I'm getting deadlocks in my example every once and a while and don't understand why it's happening. I've put the code example on pastebin because it's more than a few lines of code: http://pastebin.o...

Pthread RWLock on MAC Deadlocking but not on Linux?

I've been experimenting with rwlock's on Mac and am experiencing something that seems to me shouldn't be happening. There's some weird combination of using read/write locks with recursive read locks that is deadlocking, but shouldn't be. I posted the code on pastebin because it's more than just a snippet. The way this code is written s...

Extra character added to buffer when writing to a file in C.

mWhile attempting to make a backup copy of a file in C, I find that extra characters are sometimes generated by the algorithm below. I've also tried declaring the readBuffer within the while loop, but that did not solve the problem. Here's an example of the issue. Original File Contents Hello there. My name is Alice. Done. Backup F...

java socket writeUTF() and readUTF()

I've been reading some Java socket code snippet and fonund out a fact that in socket communication, to send messages in sequence, you don't have to seperate them by hand, the writer/reader stream do the things automatically for you. Here is an example: writer.java writeUTF("Hello"); writeUTF("World"); reader.java String a=readUTF(); /...

open_basedir won't let me write file, but directory seems correct?

Short story: I'm getting an open_basedir restriction in my php script - a simple "test writing a new file to disk" script. It SEEMS to me that I've got the open_basedir settings correct and the file is in the right location - but no luck, just the same error every time. I've searched for similar open_basedir problems on this site, but...

Unable to update sys.columns - any other approach?

Hello! I just found out, that since I created my DB on a different server that had a different collation, then immigrated to a new server with new collation, now I keep on having trouble, and I decided to change all the values of the old collation. So I tried to execute this query: sp_configure "Allow Updates", 1 GO RECONFIGURE WITH O...

Problem Writing Image file in Python with PIL

I'm writing a small Python script using the PIL module to change the size of some textures used on a 3D Model in MultiGen Creator. I'm also using the openflight API so that's what the mg* functions are. Here's the script import PIL from PIL import Image db = mgGetCurrentDb() ret,index,name = mgGetFirstTexture (db) while (ret): myAtt...