The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [file]

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path. Files are available to computer programs and are usually based on some kind of persistent storage.

Filter by
Sorted by
Tagged with
1
vote
0answers
30 views

“Function” to extract a file in Batch

Recently, I've been doing more and more Batch "programming". I always find myself in the need to extract a file and do something with the files. This is not my first version, and a few non-general-...
1
vote
0answers
19 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
1
vote
0answers
48 views

Excercise from PPP Order class

I did the following two excercise from PPP by Stroustrup: Define an Order class with (customer) name, address, data, and ...
1
vote
0answers
38 views

Speed up generate excel file

I have little knowledge about java (I'm just starting). I have issues in my generate excel file code. It takes some time to generate the file. Could you please take a look at it? ...
1
vote
1answer
742 views

Java method to load random paragraph from text file

Looking for some critique for this code. but ultimately I would like to be directed to resources/books that address my code writing weaknesses, in terms of style structure an convention : The task is ...
1
vote
0answers
34 views

Check whether or not write permission is enabled in a remote server

I have written C++ code which will say whether write permission is enable on the server or not using the smbclient command. Since the smbclient command is not returning a proper error code if the ...
1
vote
0answers
383 views

Save protobuf-net serialized data with variable length to a file

My program gets continuously raw input from a stream (TCP), then process the data and output the data to a graph. It should also save the data to a file so it can be read afterwards. To archive this I ...
1
vote
0answers
37 views

Script to append a new method to a XAML code-behind file

My company is converting a VB.NET project to a C# application and I was tasked with writing a script to automate part of the process. In particular, given information about a control name and event in ...
1
vote
0answers
26 views

Unlock spreadsheet files - follow up 2

Awhile ago I created a program that unlocked spreadsheets, for a better understanding of what happens when it's run, see here. I decided to rewrite it again, and go for a more OOP approach.. My ...
1
vote
0answers
48 views

Iteratively process an identically named file all subdirectories and plot analysis to root directory

This script can successfully go through all of the subdirectories in a root directory, and then process a specific file that exists in all of them and output the file in the root directory as a .png ...
1
vote
0answers
98 views

Counting words in files - follow-up 4

Previous question: Counting words in files - follow-up 2 Continuation of the meta programming template version of counting words. Inspired by example of pirntf ...
1
vote
0answers
164 views

Extracting country data from HTML tables

I am trying to optimize/improve my coding skills in python The rationale behind this code is to extract some data from files and store them in a dictionary. I tried to comments lines to improve ...
0
votes
1answer
158 views

Operating on a list of files using recursion

I'm starting just now with CoffeeScript and I found out that I can't solve problems like looping and recursives with just one line. I would like to improve the code that I just wrote using built-in ...
0
votes
2answers
149 views

Reading numbers from three text files in C++

This code is supposed to read some text files. What should I do in order to optimize my code. I was confused about writing a user defined function so that I can pass any text to it and it stores it in ...
0
votes
1answer
76 views

Reading lines from a file and processing them concurrently

I'd like to read lines from a file and process them concurrently. I came up with the following code to do this: ...
0
votes
3answers
117 views

Viewing test scores from one of three CSV files

Is there any way I could tidy this code and make it look better and more appealing? ...
0
votes
1answer
105 views

Appending to file slowdowns the process

The process: I read the lookup and create a list aa. I traverse through the glob.glob("C:\\project resource\\dump\\*.html") and ...
0
votes
2answers
65 views

Differences in word counts in two files

How can I change my two functions to be more readable functions (i.e. in steps), because I am using pycharm. ...
0
votes
2answers
250 views

Print every line of file, last to first, with recursion

Had a discussion with a friend to solve this extra credit problem, and we came up with two separate solutions. What are the differences between these two? Is one better than the other? How can I make ...
0
votes
1answer
13k views

Sort data from a text file in descending order using quick sort

I have a text file containing the following data. ...
0
votes
2answers
8k views

Test if file exist

bool isFileExist(const std::string& fileName) { return !!std::ifstream(fileName.c_str()); } This is a function to check if a file exist. Are there non-...
0
votes
1answer
420 views

Two similar functions for writing data to binary file using BinaryWriter

I have two functions for writing data to binary file using BinaryWriter. The first function has single data object as argument and looks as below: ...
0
votes
2answers
253 views

Reading large text file from network (SMB)

I am facing performance issues while reading a large text file from the network. The same file is read locally without any performance problems: ...
0
votes
3answers
167 views

Splitting many data files by quintile

The program below is about finding the values below the percentage and splitting them into five different output files. This works great for small input data files. But when I am trying to run it for ...
0
votes
1answer
342 views

Read Local File

I'm trying to read any file locally and write out the binary as string, it loads and reads small files very fast. How can I modifier it to read large files greater than 1gb without crashing the ...
0
votes
1answer
185 views

Powershell GetKeystate with outfile

I got a keylogger Powershell script to protocol my input, since I'm quite paranoid if someone uses my PC. However, some letters (I have an anti-ghosting keyboard) are swallowed if I type them in fast....
0
votes
2answers
253 views

Function to test whether file is in use

I needed a method to test whether a given file is in use. Is the code below up to the task? ...
0
votes
1answer
196 views

Python code to parse JSON data from CuckooML, involving many file operations

I have written a code that will parse JSON file from a cuckoo report. The issue is am not a good coder. I have got the program to give me the desired output. The real challenge that I am facing is I ...
0
votes
1answer
42 views

Simplicity decider

I was interested in the Code Golf challange about simple text. The spec is: Write a function that from a text returns the non-common words. I assumed non clean input so I cleaned it before ...
0
votes
1answer
32 views

Process CSV files that follow the first nonempty one

I have a list of CSV files (all have the same fields), some of which are empty. My goal is to find the first nonempty file and use that as the "base" file for an aggregation. After finding the base ...
0
votes
2answers
94 views

Give function get file extension for you

I have written a function that retrieves the extension from a given file name for you. I would like to make this more efficient and increase it's performance. ...
0
votes
1answer
61 views

How I can make file multiple of `segmentSize` [closed]

I multiply the original file and cut a piece of final file with intention to do it a multiple of segmentSize times with minimum loss of data. Example: I have a ...
0
votes
1answer
315 views

Reading and writing configuration file

I am working on my first open source project, and I have read a lot to get the desire coding style and I think I got it. But before go further I want to get reviews about my code. This script is not ...
0
votes
3answers
62 views

Opening and validating an XML file

I have a section of code that repeats many lines and I am looking to refactor this code possibly so that a function can be used instead of the same lines of code each time. Below is the section of ...
0
votes
1answer
46 views

Split a file into individually allocated lines

This is part of a larger project that is to run on POSIX systems. My concerns with it are the lack of comments, best practices with the filesystem, and naming things. Of course all feedback is great. ...
0
votes
1answer
47 views

Unlocking spreadsheet files quickly - follow-up

I recently posted a program I made to unlock spreadsheet files( see also ), I've taken all of your advice and made it more Ruby like, it has no shell commands in it, and uses ...
0
votes
1answer
340 views

Reading and writing an unknown character into an appropriately named file

I would like to refactor this code a bit further and make it better and more generic. As of right now, it is doing what I want it to do (reading a list of URL's, splitting the query and the ampersand ...
0
votes
0answers
44 views

Optimize the file content comparison

Program to compare if files within two directories are having same content I followed the approach of getting the list of files under two directories recursively and store it in different list with ...
0
votes
1answer
311 views

Reading file and print it in hex format really slow

I'm trying to read a file and print its byte in hex form, using the below code. The code those it but i think optimization can be done to make it read and print faster, because if i remove the print ...
0
votes
1answer
116 views

PHP Cache weather in a file

I'm using the darksky api to get weather data for a display board website. The free version is limited to 1000 api calls per month. I have a lot of devices (iPads) displaying this information in ...
-1
votes
1answer
3k views

C++ File handling, inserts ÿ character while copying contents [closed]

[Please don't comment on using Turbo C++. I know that it's obsolete but we are taught this way only.] ...
-1
votes
1answer
457 views

Binary File Handling Program [closed]

Please review this code : ...
-1
votes
1answer
748 views

Reading bytes from file to compute its SHA256 hash

I need to get text hash (sha 256), so I need to convert file to its type representation. Is this a fast way to get a byte representation of a file? ...
-2
votes
1answer
648 views

Retrying to read a file [closed]

I have a piece code which retries 3 more times to open a file (see below). Are there potential problems or side effects with the way it is written? How can it be improved? Also, why would one use <...
-2
votes
1answer
42 views

Finding phrase in specified files v2 c++

Please provide constructive feedback so I can learn from my mistakes. Please tell me what I did right and where I came up with very good solution and where I should improve. Here is the code (Please ...
-2
votes
1answer
63 views

Merging files in Bash

I had this homework assignment: Create on the desktop a folder with your name. Copy from your account XYZ@xyz.com two files, ...
-2
votes
1answer
5k views

file downloading using jsp but not readable [closed]

I am trying to download files using jsp but then downloaded files are not readable. Suppose if i download pdf files then it can not opened,if i download jpg files then it can not opened and similarily ...
-3
votes
1answer
58 views

Code creates huge Text File [closed]

A Java program that writes each digit on a new line, from 1 to max integer. We should end up with 2.4 Billion lines. After looping to near the maximum integer, the text file becomes really huge. Like ...
-3
votes
1answer
157 views

C++ program involving reading and displaying information from a file? [closed]

This is a program I made for practice in file handling in C++. The purpose of the program is to write three nos 1 2 and 3 into a file abc.dat and then read it and display it on the monitor. When I ...
-3
votes
2answers
3k views

Working around a Segmentation Fault for reading Files in C [closed]

I am getting a segmentation fault on the below snippet, only when I go above a text file in the range of 80-100kb. It will read smaller files of text but otherwise ...