Most voted "filing-cabinet" questions
A (Brazilian Portuguese) or (European Portuguese) computer file is a resource for storing information, which is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available to programs for use after the running program has been completed.
Learn more…693 questions
Sort by count of
-
35
votes2
answers31112
viewsWhen to use ANSI and when to use UTF-8?
Is it more advantageous to use an ANSI type instead of a UTF-8 type or vice versa? Is there any gain in performance or storage between types?
-
31
votes6
answers36799
viewsHow to read a text file in Java?
I have the file called dados.txt and I want to put it on String. For example: String texto = lerArquivo("conteudo.txt"); Question How to write this method lerArquivo()?…
-
29
votes3
answers847
viewsDoes merging PHP files into one only increase performance?
I get the impression that every time I execute the command dump-autoload to generate the autoload of the classes via composer, an archive bootstrap/compiled.php is created. Within it, there seems to…
-
27
votes4
answers15751
viewsHow to check if an image exists in a remote URL?
In order to have the administration of a website to be performed from a server other than the one where the website is hosted, the problem of dealing with remote images has arisen. Common problems:…
-
20
votes4
answers6604
viewsHow to extract a file extension in Javascript?
There are some cases where I need to capture a file extension (that is, a string with the file address) in order to validate the extension via Javascript. For example of location: var path =…
-
17
votes2
answers4913
viewsHow to check if a file is in use without launching C#exception
I have an application that processes a file queue. I need to open the files for reading and writing. Sometimes the files are in use when I go to process them. How can I check if the file is in use?…
-
15
votes4
answers31096
viewsWriting and reading file via Javascript
It is possible (if, how) to do the following method with Javascript? The person type in a form some arguments, by clicking submit it will run a Javascript code, in this code the function will take…
-
14
votes1
answer1783
viewsHow to read binary file content in Javascript
How to read binary file content in Javascript?
-
13
votes3
answers15049
viewsHow to check if a file exists using Python
How to check if a file exists, in Python, without using a block try:?
-
13
votes3
answers17303
viewsWhat is the best way to read an XLS file?
I would like to know the best way to read an XLS file in C#. I can handle it the same way I handle a database table?
-
13
votes5
answers11978
viewsHow to get the current file name
I recently had a problem identifying the current page. Was using __FILE__ to get the current file, and used substr() to retrieve the string after the last occurrence bar, it turns out that in some…
-
13
votes2
answers6409
viewsWhat is a stream?
In both PHP and C#, languages I’ve been using in my day to day life, I’ve come across a common term: Stream. Whenever I hear the word Stream, the first thing that comes to mind is Youtube, among…
-
12
votes2
answers2282
viewsHow to do binary search in a txt file?
I am with a txt file that stores data from several books (example below) I would like to make a binary research that returns the line that is with the first field (ISBN of the book) equivalent to…
-
11
votes5
answers1562
viewsOptimize function to include classes also looking in sub-directories
I have the following function to include classes when we are trying to use a class that has not yet been defined: /** * Attempt to load undefined class * @param object $class_name object class name…
-
11
votes2
answers604
viewsRead all the contents of a text file
I need to read all the contents of a text file and put it into a string. Usually, I do so: using(var reader = new StreamReader("arquivo.txt")) { var strBuilder = new StringBuilder(); while…
-
9
votes4
answers2855
viewsHow to merge multiple text files into one?
Does anyone know how to select all text files from the same directory and join the information of all of them in just one final text file? Example: In folder X, I have files 1.txt, 2.txt and 3.txt.…
-
9
votes2
answers202
viewsWhich is faster to read and edit, a database or a . txt?
It would be to store and rewrite only 1 digit INT, erasing one and writing another, on the condition that when it reaches 5, go back to 1, and go on doing that loop every time someone accesses.…
-
9
votes1
answer832
viewsHow to copy a file from the network to my computer using C#?
I have a desktop application that needs to copy media files from a server, videos and images. The server is on the same network as the terminal on which the program will be installed. The problem…
-
9
votes1
answer3563
viewsWhat is the maximum size of a JSON file?
I will give an example to explain my doubt: I need to recover information from images coming from an API, this image bank returns JSON’s with information of the images I need, in all there are 33…
-
8
votes1
answer1584
viewsForm with a "file" type field arrives at the server with "$_POST" empty
On our hosting server, I have two projects, where both are with a module in our administrative area to manage images. In the project To, the form is submitted to the server and the $_POST is…
-
8
votes3
answers4774
viewsHow to improve file recording speed for a Clientdataset?
I’m integrating a system with a bank file, and I’m having a problem with the process. I receive from the credit card operator a plain text file with approximately 1300Kb and about 5,500 lines. I’m…
-
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…
-
8
votes2
answers1720
viewsWhich is faster, access data in file or database?
In terms of performance which method is fastest to recover data, 1) read a file (which will be generated only once with PHP) or 2) take this data from a database? This data will always be shown on…
-
8
votes1
answer112
viewsCan you use a dialog to open both folders and files?
Well, I’m using the openfiledialog to open files, however the software needs to receive files or folders, because it compressed and zipped (.zip) and then make a symmetrical cipher. I have searched…
-
8
votes2
answers156
viewsHow to Ensure Writing File on a Single Disk Block?
Performing several searches in a few days I found nothing that guarantees that my file will be written in a single block of the disk (I know that block is only a metaphor for sectors of the disk…
-
8
votes1
answer159
viewsHow does logic work to figure out the size of the image?
In PHP and other programming languages, it is possible, through some special functions, to discover the image size. For example: list($width, $height) = getimagesize('images/icon.png'); I was…
-
8
votes3
answers939
viewsWhat is the difference between Directoryiterator and Filesystemiterator?
In PHP, there is the class Directoryiterator. The Directoryiterator class provides a simple interface for viewing the Contents of filesystem Directories. There is also Filesystemiterator, that the…
-
7
votes3
answers1689
viewsHow to read file passing part of the name in Java
Example.: The name of my file would be 001nome.txt, this file will have a varying action on the name depending on the entity, ie one time it may be 001nome.txt another time it may be 999nome.txt.…
-
7
votes1
answer898
viewsWhat is the difference between puts() and fputs()?
I know both functions are for display strings on screen. But what’s the difference between them? Which one is better to use?
-
7
votes1
answer976
viewsHow to move files read by Streamreader in C#?
I am trying to move some files. For each file containing the word "TEST" in its body, my application indicates being a found item. The goal is to move them to another directory. Follow the code…
-
7
votes2
answers10840
viewsHow to read a large file row by row with Javascript (nodejs)
I have a very large file to import data to Mongodb via Javascript. The problem is that I cannot load the entire file into memory. I would like to read this file line by line, since each line is a…
-
7
votes2
answers15219
viewsGrab the file extension
Hi, I tried to use the pathinfo() but I guess I didn’t use it the right way, I’d like to know how to use. $arquivo_up = $_FILES['arquivo']['name']; $extensao = pathinfo($arquivo_up); $extensao =…
-
7
votes1
answer1322
viewsRemoval of random numbers in AVL tree
I have to implement an avl that gets 10,000 random numbers from 1 to 1000,000, right after that, I have to remove 1,000 random numbers, both taken from files. txt, I can enter normally, but when it…
-
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"?
-
7
votes2
answers3036
viewsHow to check which file is the latest in a Python folder?
Suppose you have a folder with several files .txt, with different names, I need to know the latest file. How do I do this using Python?
-
6
votes2
answers1602
viewsDisplay "longblob" field content containing PDF file
I have a question about the data longblob which are stored in the Database. I currently have so for the other data: echo "<tr><td>Email:</td>"; echo "<td>"; if…
-
6
votes3
answers1504
viewsCopy file with progress
How I use the C function# File.Copy(string path); to copy a file by incrementing a value in a Progressbar?
-
6
votes2
answers934
viewsHow to create an index file using B+ tree
I have a B+ tree that acts as the index of a data file. This index must be saved in an index file. A struct node or node of the B+ tree is: typedef struct node { void ** pointers; int * keys; struct…
-
6
votes2
answers5045
viewsHow to check in C if the file is empty?
Good night, I’m working with C, and it turns out I have a function or method that you have to print to a file the data, the meal appointments,. In the method the system has to check if that file is…
-
6
votes1
answer312
viewsPage Printing
Good morning, I wonder if there is any way to count how many times a given page (html) has been printed. I know we can count the times a modal was opened with the click of the button, in this same…
-
6
votes4
answers2166
viewsHow to know the number of lines a large file has in php?
How do I know the number of lines in a file using PHP? I know there are functions like file, which returns all rows of the file in one array. We could just use one count, but the problem is I need…
-
6
votes3
answers459
viewsDoes C# have a class for handling properties files?
In C# has some class for handling files properties? In Java I use the class Properties, I was wondering if you have a C equivalent#?…
-
6
votes1
answer91
viewsMini search engine
I am making a mini search system for urls that are stored in a.txt file, one per line, my problem is the performance issue because I have 5000 urls stored (only) and it is already slow in searching,…
-
5
votes1
answer170
viewsRead files in a directory sorted by creation date
I have the following code to include all PHP files I find in a directory: if (is_dir(CONF_REL_PATH_BANANAS)) { foreach (glob(CONF_REL_PATH_BANANAS.'/*.php') as $file) { require_once($file); } } When…
-
5
votes2
answers927
viewsObjectoutputstream only saves the first object
I’m trying to manipulate a Byte file with Java. In the writing of the file I have the following code: FileOutputStream fos = new FileOutputStream("files\\Produtos.dat",true); ObjectOutputStream oos…
-
5
votes1
answer9094
viewsHow to read folder and subfolder files?
I have a function to read the files in the folder, and it’s not working. I need a functional function that reads files from folders and subfolders. Follows the code: FolderBrowserDialog fbd = new…
-
5
votes2
answers3824
viewsWhat is the best way to save files, Bank or File System?
I have a demand to attach Pdfs to my application. The files have varying sizes, from 5 to 200 MB or more. Here comes my question: what is the best option to store? Direct in the database…
-
5
votes3
answers586
viewsFind files containing string and rename
To locate files whose name contains a particular string, we can resort to find as follows: File example: 1429331804.H568641P9577.xxxx.example.com,S=17846:2, Command to locate by xxxx.example.com:…
-
5
votes2
answers1522
viewsHow to read data from txt files using Java?
Is there any mechanism to store the data of a file in a Linkedlist .txt? For example, how would this list have as elements the strings "Caio", "Pedro" and "Luiza"? import java.io.*; public class…
-
5
votes2
answers157
viewsWhat’s position on Sqlserver?
I have a question. I received the layout of a table containing: Nome do campo | Tamanho | Posição | Tipo The Position contains: De | Até And one of the fields is: Histórico ( no caso da Posição ):…