Most voted "fopen" questions
36 questions
Sort by count of
-
8
votes2
answers15096
viewsHow to count the number of characters of the word that came from the first line of a text file?
Below is an example of how to count the number of characters in a string: $palavra ="coisa"; echo strlen($palavra); //retorna o número 5 However I am taking this word from a text file and the strlen…
-
7
votes2
answers157
viewsWhat does the expression "a+t" mean in the second parameter of fopen in C?
I was coming across a code here and I was curious about this excerpt: FILE *fp = fopen("Agenda.txt","a+t"); What’s the point of "a+t"?
-
3
votes1
answer1258
viewsRead a list of lists in txt python 3
I have a pretty giant list of lists and it keeps getting in the way of my code. So I wanted to save this list in a txt file and ask the algorithm to save this list in a new variable. Suppose my list…
-
3
votes2
answers1461
viewsAdd data to a txt file
I have the following code: $msg = "teste"; $myfile = fopen("lista.txt", "w"); fwrite($myfile, $msg."\n"); fclose($myfile); If I change the variable value $msg it opens the file deletes the $msg and…
-
2
votes2
answers431
viewsHelp to determine vector/matrix size - C language
What I’d like to do is put into a vector or matrix, information from a file txt no prior knowledge of the number of "inputs" to know the size of the vector or matrix. With the size of the vector or…
-
2
votes1
answer135
viewsReading and writing problems
Assuming you have an access log, each request will create or include values in the log file. Simulating several requests via ajax, I found that there is always a problem. If you log into the browser…
-
2
votes1
answer871
viewsProblem with fopen
This file is performing its function perfectly, but it is returning some errors and I would like to be able to correct them. I need to know if I have to use the fopen and the file_get_contents…
-
2
votes2
answers624
viewsphp cannot copy remote file, but download it from the browser
Hello. This file: http://www1.caixa.gov.br/lotteries/lotteries/lotteries/D_megase.zip I can download from the browser, but I can’t copy directly to my server using PHP. I have tried every possible…
-
2
votes2
answers164
viewsDoubt about PHP command to write inside another. php file
I’m finding a problem in the following code: <?php $id = $_POST['id']; $titulo = $_POST['titulo']; $imagem = $_POST['imagem']; $coment = $_POST['coment']; $finalcoment = '<div…
-
2
votes2
answers303
viewsGiving "Segmentation fault" when I try to open C files
The following code gives me "Segmentation fault (core dumped)" when trying to open the file after declaration and filling a string with sprintf. //Sem as duas seguintes linhas, o código roda…
-
2
votes1
answer524
viewsError creating a fopen file
When trying to create a file in JSON format with fopen I am returned a permission error with the following message: Warning: fopen(/json/9.json): failed to open stream: No such file or directory in…
-
1
votes2
answers146
viewsText problem cut when creating text file
I need to create a file that contains PHP code. This code comes from a string like "<?php class foo{ } ?>" but when I give a echo she just cuts out the reserved words. How to turn the string…
-
1
votes1
answer232
viewsReading file in Objective C
I’m trying to read a file on. c, I can read everything right there but in the variable it returns me a whole content and a " n" that harms the rest of my code. Below is the section that performs the…
-
1
votes2
answers718
views -
1
votes1
answer270
viewsAccent problem when generating txt in php
I am using the code below to generate a txt file but is generating a strange code. <?php header("Content-Type: text/html; charset=UTF-8",true); $fp = fopen("bloco.txt", "w"); $eu = 'é';…
-
1
votes0
answers66
viewsHow to make a Json_decode from a json file
Hello, I am currently storing data in json format in a fopen file. $json = fopen("$root/apil/Controllers/json/" . $this->getX_id() . ".json", "w+"); $customers_results =…
-
1
votes1
answer37
viewsfopen returning NULL
Good evening, I’m having a problem in fopen function within a subroutine. This returning NULL. I could not identify the error because I am still beginner, if someone can help me. Note: I declared…
-
0
votes1
answer102
viewsNew PHP line in fopen function
Good people, I was following a PHP booklet and so far so good, but the problem is in writing the data in a notebook of windows, instead of it giving new line " n", he is putting the data behind each…
-
0
votes1
answer36
viewsHow do code record information from multiple files?
I have a watermark code on every image that was uploaded. At the end of this code, I would like every time a person uploads the image, to create a record in a notepad. I arrived at this code but I’m…
-
0
votes0
answers26
viewsError generating image report
I have a code that has several photos separated by reports. Each report can any amount of photos. When you click the button to generate this report, if you have several photos (around 60) it starts…
-
0
votes0
answers56
viewsHow to create file on my PC, within an internal network, using PHP
I am developing a software for the company I work with and a problem has arisen: I need to create a file inside my PC that is saved using any other computer from the internal network of the company.…
-
0
votes1
answer277
viewsCreate / Edit a file on the server (Apache)
With the following code I would like to create a file on the server. <?php date_default_timezone_set('America/Sao_Paulo'); $nomeArquivoLogDia = date('Ymd') . '-teste.log'; if…
-
0
votes1
answer158
viewsHow to ignore comments on P3 ppm files?
In the ler_arquivo_ppm_p3(const char *filename) function how would you ignore comments (# comet) in ppm P3 files? #include <stdio.h> #include <stdlib.h> typedef struct PIXEL { int r, g,…
-
0
votes1
answer108
viewsProblems with permission
I have a server where five websites are hosted. One of them has a system where you download a file that is in the hosting of another site, but of the same server. The file is there, but at the time…
-
0
votes1
answer149
views -
0
votes2
answers820
viewsC program does not correctly read a . txt file with integer numbers
I’m with this C code where the goal is to read 25 whole numbers of a text file and store them in a 5 by 5 array. The problem is that when running on MS-DOS, the program prints only junk from memory.…
-
0
votes2
answers72
viewsC program does not read values in txt file
Guys, I’m back again. I applied some changes that the members here suggested in another post, but the values are still not read correctly. Now gives up to integer values (before DOS printed negative…
-
0
votes0
answers119
viewsHow do I automatically create a new page for every new post I do?
I’m creating a news portal in PHP. How can I automatically create a new page (with header and footer) for every post I do? I’m trying to do this with fopen / fclose, but I don’t know how to make it…
-
0
votes2
answers1331
viewswrite struct to file
I’m trying to record a struct in a file via language c. But whenever I run the program on xcode nothing is recorded in the archive. I have tried the file permissions system, but there is nothing…
-
0
votes0
answers44
viewsDelay when generating txt file and downloading using php
The problem is the following: The application makes a query in the database like size, color, price, etc... This will be placed in the txt file for later use inside the stock collector. The problem…
-
-1
votes2
answers732
viewsHow to capture a line from a file and then overwrite?
I have to access a file by php, this file has a variable at line x I want to take the contents of this variable, step to a condition, if other than expected I replace the value of this variable by…
-
-2
votes2
answers124
viewsError saving JSON via fopen, downloaded via Curl
The command below, accesses an API via Curl, searches for a JSON file, creates a folder inside the /logs folder, and saves the JSON file, so far no problem. However when saving the JSON file it is…
-
-2
votes0
answers38
viewsChanging contents of a variable
Guys, is there any way I can alter the field exact of a php variable. What I have is this: A file called mudarpassword.php <?php if (isset($_POST['clicado'])) { $file =…
-
-2
votes2
answers48
viewsC Language - Read binary file in its full size
I’m developing a software that needs to read a binary file and display its contents. Currently it is displaying the content correctly, but I do not know how to do the loop read the total content…
-
-3
votes2
answers105
viewsfopen(/home/loyusgyp/public_html/logs/log_jurosefine/log_2020-02-02_18-00-01.txt): failed to open stream: No such file or directory in (Cpanel)
I’m having trouble recording a log on my hosting server (hosting uses Cpanel). I created a job of correction of interest and fine, but when the job runs it accuses the following error: Warning:…
-
-3
votes1
answer64
viewsHow to Store Data from this Code?
/It is to take the data that are appearing there example when you click on the button appears the time and amount of clicks I want to take these two information and store anywhere that of to store…