How to edit json file with data and save it

I have a json file with a lot of objects. This file is located in res/raw. Im reading this file and showing objects in list in my UI. And after user closing activity with this list, changes that user made most be saved in file that was read. ...
more »

2017-04-18 14:04 (3) Answers

Add comment on image file header

I want to add a comment(s) in image file header. As I able to add a comment on EXIF metadata under UserComment but I want to add multiple comments in image file header. Which framework do I use? For UserComment, I am using ImageIO framework. ...
more »

2017-04-18 08:04 (0) Answers

File system: Kernel calls vs. Caching

I would like to write a file manager for educational purposes. I'm planning to split the software to a backend and a frontend. The backend would do file system caching like this: User double-clicks the directory /foo/bar in the frontend Backend r...
more »

2017-04-16 15:04 (1) Answers

C - for loop ends early

Full code: FILE *fptr; char regPlates[350][10]; // array of registration number plates, e.g. AA234BB switch (userInput) { case 'a': // check available spaces ReadFromFile(); CheckEmptySpace...
more »

2017-04-13 16:04 (0) Answers

How to find a file into a folder by its code

I have a folder with too much files. So, i need to re place this string: < span class="title-price"> From < / span > but I don't know where I can find it. Is there a way to know which file contains the string? Formats of the files...
more »

2017-04-07 14:04 (3) Answers

Save javascript array to JSON file

I have written a script for private usage and I'd like to be able to save generated array data into a file in JSON format. I can give the script to the user, so he'll be running it on his machine. Is it possible to save files using JS/ jQuery when th...
more »

2017-04-04 15:04 (0) Answers

Sublime Text 3 find and replace in multiple files

I want to find and replace code in multiple files. Does anyone know if the feature "find and replace in multiple files" in Sublime Text 3 is gone? It used to be a feature for ST2 (shift-command-F), see screenshots ST2 and ST3. Or is there a othe...
more »

2017-04-02 17:04 (1) Answers

Use fread efficiently to read sparse data

I have a file that stores the data like the following A1 B1 C1 ... A2 B2 C2 ... .... An Bn Cn ... Here Ai, Bi, and Ci are blocks with 16 bytes. Each chunk Ai Bi Ci ... could be >1M large, and n could be 256. I wanted to read A1, A2... An in sequ...
more »

2017-04-02 06:04 (1) Answers

Find all files that have set UID bit on

I'm trying to find all files with the permission "SUID" and write it to a text file, but when I run the following command, the text file is empty: sudo find / -perm 4000 > suid.txt Is there a problem with my command? ...
more »

2017-04-01 05:04 (1) Answers

Passing file in memory from fstream to FILE*

Is it possible to open a file using fstream and passing the file itself, in memory, to FILE*? For instance, opening a file in fstream and storing the file itself (content) in a string then passing it to FILE* without FILE* having to access a file on...
more »

2017-03-29 15:03 (0) Answers

File search by inputed values

I have problem with file search. I have 2 text forms in which I want to input value for search in file. But somehow if I write input in one of the form, it is also displayed in other line (I don't want this). Also my search works only by one of searc...
more »

2017-03-26 16:03 (1) Answers

Async operation inside callback of event

I'm working with a module called findit, which recursive find files within a target folder and return the events "file", "error", "end": const finder = findit("folder/"); finder.on("file", (file) => {}); finder.on("error", ((error) => {}); fin...
more »

2017-03-25 19:03 (3) Answers

C# File.Exists returns false, file does exist

Using VS 15, C# with .Net 4.5.2 The computer is on an AD network, with the ad name "AD". This problem happens with AD normal-user rights, AD admin rights, and local admin rights. It doesn't matter what rights the program gets, the same problem occurs...
more »

2017-03-23 14:03 (2) Answers

Ruby: Iterating through dir's and files

I wrote the following script to iterate through a directory, it's subdirectories and their files: def self.search_files_in_dir_for(dir, strings) results = {} puts "Initializing test ..." Dir.foreach(dir) do |file| ...
more »

2017-03-17 22:03 (1) Answers

Batch file, search file and replace string

I'm trying to create a batch file who will search for a specified file and will replace a string in it by something else The problem is that the path is different for each user. The file is prefs.js, and it's located in C:\%username%\AppData\Roamin...
more »

2017-03-17 18:03 (1) Answers

How to save to an INI file delphi

I have buttons which when clicked store their caption in a TStringList ChairList : TStringList; procedure TForm1.FormCreate(Sender: TObject); begin ChairList := TStringList.Create; end; An example of one button is: procedure TForm1.Table17Click(...
more »

2017-03-17 10:03 (4) Answers