Skip to content
Advertisement

Tag: fopen

fopen() returns inavlid argument when writing on SD card?

I’m trying to write a file on SD card if it’s inserted into the kit. Otherwise, the file should be written to the current directory of the project. I can write the file in the project’s directory without any problems. However, when I try to write it on the inserted SD card, it returns Invalide argument! I tried changing the

C – get list of opened handlers – duplicate entries

I have this code to retrieve list of opened handlers (mostly FILE) However, when i call single fopen and run this, it prints the same file multiple times (from n to FD_SETSIZE, where n is some offset id… first 0 .. n are some system handlers like dev/nul etc.). Answer Your error check after fcntl(fd, F_GETFD, 0) is a bit

PHP isn’t able to read file

I’m stuck trying to open a file with fopen in php. I checked following items: chmod for statuseing.php 0777 owner is www-data with groud www-data script is running as user www-data groups are uid=33(www-data) gid=33(www-data) groups=33(www-data) pwd is /var/www/html as expected the path the scripts want’s to open is correct checked openbase dir in php.ini showed in phpinfo(), added /var/www/html,

PHP fopen ‘x+’ doesn’t work on ubuntu

I created an application which has an caching script on an Windows/Wamp environment. This script’s caching function is only allowed to run once at the same time. To achieve this I used a ‘locking file’ with check to see if it exists. On windows this script continues to work fine. But now it is moved to an Ubuntu environment is

Linux kernel : logging to a specific file

I am trying to edit the linux kernel. I want some information to be written out to a file as a part of the debugging process. I have read about the printk function. But i would like to add text to a particular file (file other from the default files that keep debug logs). To cut it short: I would

trouble with opening file for read with fopen

I am new to writing c under linux so this will be maybe silly question, but I have problem using fopen. When I encountered the problem I just tried it with this really simple code: test.txt is in same folder as this code and a.out. When I debug a.out I get: I tried changing the path: if( fopen(“/home/h1657/Work/test/test.txt”,”r”) == NULL

Advertisement