Category "file"

merge all files in directory to one text file

In PHP, how can I open everyfile, all text files, in a directory and merge them all into one text file. I don't know how to open all files in a directory, but

How Django set path to files

In a django project, I want to open a file "file.png" (from images folder) in "worker.py". worker.py images file.png otherfile.png It works well using the te

Why can the posix thread id be NULL in Linux kernel function filp_close?

Below is excerpted from linux kernel: /* * "id" is the POSIX thread ID. We use the * files pointer for this.. */ int filp_close(struct file *filp, fl_owner_

How to open file in another directory in java?

How to open a file that is not present in the current directory but in another directory. For example, I have a folder F:/test and my file is in F:/test/test2/d

Java - Getting file from same package

If I want to read from "Words.txt" which is in the same package as the class, how would I do this? Doing simply Scanner = new Scanner(new File("Words.txt")); re

What file extensions can be created/written with Java's Writer write() method?

I have a question about Java streams but I can't seem to find the answer in the documentation: What file formats or extensions can be written with java.io FileW

how does fscanf works with different variable types?

I was looking at the MSDN documentation for fscanf. I tried changing the sample code in the documentation, but it didn't work as I expected. If, for example, I

Adding text and lines to the beginning of a file

I'd like to be able to add lines to the beginning of a file. This program I am writing will take information from a user, and prep it to write to a file. That

Get file size, creation date and modification date in Python

I need to get file info (path, size, dates, etc) and save it in a txt but I don't know where or how to do it. This is what I have: ruta = "FolderPath" os.list

How to 'cut' on null?

Unix 'file' command has a -0 option to output a null character after a filename. This is supposedly good for using with 'cut'. From man file: -0, --print0

Read users and passwords from a txt file

I have a txt file which looks like this USER: user46226234 PASS: #)(HF(WE*FHWE USER: user49503420594 PASS: yellowbird USER: user449202934 PASS: dog I'm trying

How to check if file is being used by another process - Powershell

I am trying to find a solution which will check whether a file is being used by another process. I don't want to read the contents of the file, as on a 7GB docu

Using Windows Batch Files to split large "Wrapped" files

I need a method to split files into multiple (or even half) based on KB not on number of lines. I am a Senior EDI Analyst and wrapped data tends to show up as

How do I move files in node.js?

How can I move files (like mv command shell) on node.js? Is there any method for that or should I read a file, write to a new file and remove older file?

Eclipse - Show generated class files

How can I show the folder (bin) where my class files are placed after I build a project in eclipse? I want this directory to show up in the package explorer. Se

python .write is making unwanted spaces between lines

I'm running into a problem in python about writing files as txt files from clipboard. I'm using pyperclip.paste() to get the data from clipboard and write the f

Listing all directories recursively within the zipfile without extracting in python

In Python we can get the list of all files within a zipfile without extracting the zip file using the below code. import zipfile zip_ref = zipfile.ZipFile(zipf

Cannot get file of FormData (angular 13) from Symfony 5.4

I hope you are fine, I have a problem to get file of FormData in Angular 13 send to Symfony 5.4. onFileSelected1(event:any){ const file:File = event.t

How to do non-cached file writes in C# winform app

I'm trying to determine worst case disk speed, so I wrote the following function. static public decimal MBytesPerSec(string volume) { string filename = vo

What is the fastest way to check if any files in a directory tree have changed?

Currently I'm checking against an XOR Checksum of the modified file time (st_mtime from fstat) for every file in the tree. I'm coupling this with the number of