Category "file"

I keep getting the error "[Errno 21] Is a directory:" when recalling a text file from a zipped file

I have a zipped file that I have unzipped that contains text files in the date format "yyyymmdd.txt" and when I try recalling a certain date's file I keep getti

out of memory error when reading file with json.loads in python

hi i create a file and fill it with below code: i have some lists which i fill them and write them in file. each list will be written in one line. import json

Buffered reader does not flush characters to buffer when reaching EOF

I have a buffered reader using read(buffer, off, len). The reader is reading a txt file into a buffer of 2048 characters. It reads and prints whats in the buffe

React native html to pdf

I am using this code and it works fine in simulator as I am getting a location and can get pdf file from there async createPDF() { let options = { html

Why is my python executable not able to create files but can access data on runtime?

A little bit of context: I have made a password manager in python I then packed it into a single executable using: pyinstaller --onefile password_manager.py Oka

Alternative for File.createTempFile?

I don't want the extra number after file name when it is created using createTempFile. But I believe it is not possible to remove them. (How to change default n

Share file .txt Android

I'm trying to share a .txt file to another app (gmail for example) but I have some problems. I decided to use the file provider. When I select gmail among the a

Python - Why is the function not working when reading from file? [closed]

This is the code i have used file

Can you read a File only from a certain character using SeekableByteChannel

In a text file I need to read the part after ':' using SeekableByteChannel, can I do that and save the number of Bytes read and also the number of Bytes skipped

Operate on .dat file, pickle mod

I have project to do in my studies and it is my first project in Python. I must create simply program for bank. With GUI I'm creating an account on classes and

Saving files in Android 11 to external storage(SDK 30)

I am writing a new Application on Android 11 (SDK Version 30) and I simply cannot find an example on how to save a file to the external storage. I read their d

Get the file list of a folder with Dir

I'm trying to get the file list of a folder in VBA The DIR command acts as if the * wildcard is messing up the whole mask that I input. Here is my file list: No

Reading a text file in Android Studio Kotlin and making pointers

I am fairly new to Android + Kotlin, however I am wondering if there is a faster way to read a text (.pgn) file and mark pointers to places in the file for late

res.set('Content-Type','image/jpg') is not working while serving image in node js

res.set('Content-Type', 'image/jpg') is not working while serving us files in node js. Please take a look at code what is wrong with this code. I am getting the

sed replacing first occurence of characters in each line of file only if they are first 2 characters

Is it possible using sed to replace the first occurrence of a character or substring in line of file only if it is the first 2 characters in the line? For examp

How to identify whether an item inside ZipFile is a directory

Consider a zip file that contains a directory with some files inside, e.g. contents of sample.zip are: Archive: ziptest.zip Length Date Time Name

How to gain access to a specific folder and write a file into it using Scoped Storage

My app has a feature that exports GPS data in txt format into a shared folder (now accessed with getExternalStorageDirectory), and I have to switch it to Scoped

fileinput.hook_compressed gives me strings sometimes, bytes other times

I'm trying to read lines from a number of files. Some are gzipped, and others are plain text files. In Python 2.7, I have been using the following code and it w

How to convert Web Stream to NodeJS native Stream

I am taking file input from user as <input type="file"/> It returns file object has Blob. This object has a method .stream() which returns ReadableStream

How to loop over on different files and save the output with filename in R?

I have several files with the names RTDFE, TRYFG, FTYGS, WERTS...like 100 files in txt format. For each file, I'm using the following code and writing the outpu