Category "file"

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

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

Limit file format when using <input type="file">?

I'd like to restrict the type of file that can be chosen from the native OS file chooser when the user clicks the Browse button in the <input type="file">

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host

I have an update server that sends client updates through TCP port 12000. The sending of a single file is successful only the first time, but after that I get a

Remove a file from the list that will be committed

I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do: git commit -a To commit all files

How to determine the file extension of a file from a uri

Assuming I am given a URI, and I want to find the file extension of the file that is returned, what do I have to do in Java. For example the file at http://www

php script to delete files older than 24 hrs, deletes all files

I wrote this php script to delete old files older than 24 hrs, but it deleted all the files including newer ones: <?php $path = 'ftmp/'; if ($handle = o

How to stop process from .BAT file?

So I have process I started from one bat file. How to stop it from another?