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.
81,629
questions
0
votes
0
answers
8
views
Experiencing an error when trying to import from a diffrent directory
i am trying to import a function from another file
a/b/c.py
a/1/2.py
i wanted to import a funciton from c.py in 2.py
sys.path.insert(1, '/path/to/c/py/a/b/c')
from c import function1, function2
i ...
1
vote
0
answers
23
views
The getter 'MyRoutes' isn't defined for the class 'MyApp'
I have two screens in my app 1. homepage 2. loginpage and I want to navigate from login page to homepage on a button click through routes.
the routes are define in separate file utils(folder)=>...
-1
votes
1
answer
24
views
How to set a file permission to prevent deletion in Python?
I'm working on a Python project and I need to prevent a file from being deleted. If it's not possible to make the file undeletable, I would like to at least make it read-only and unchangeable.
I've ...
1
vote
2
answers
36
views
HTML audio with javascript: playback of playlist is not correct -> index 2 is always skipped
Need someone to help me understand, why index 2 of the playlist array that is passed to the audio element is skipped - no matter what. This is the console output:
0: /track01.mp3
1: /track02.mp3
2: /...
0
votes
0
answers
18
views
unpack requires a buffer of X bytes
field_names = []
for i in range(obj["fields_cnt"]):
print(i)
name_len = struct.unpack('H', f.read(2))[0]
print(type(name_len))
print(...
0
votes
0
answers
10
views
how to resolve issues on Kaggle,This preview is truncated due to the large file size. Create a Notebook or download this file to see the full content
enter image description here
how to solve the question on kaggle:
This preview is truncated due to the large file size. Create a Notebook or download this file to see the full content.
I have been ...
0
votes
1
answer
52
views
How to write to a user input file name in python [closed]
I have to create and write to a file that's named by user input.
The user is naming the file so the program cannot have a set file name to open. I thought I could do this by setting an input variable. ...
-2
votes
0
answers
37
views
Why are these files unable to be written to this specific directory?
Right now, I am having an issue of when I press the upload file button, the error I am getting is "Error uploading files: failed to move uploading file." The end goal is for these files to ...
2
votes
1
answer
38
views
App Crashes Whenever Trying To Read File Saved Into Internal Storage In Android application
I'm trying to create a simple android application where value from a text field is saved into a file and is then later displayed on screen in a text composable on a button press, however the ...
1
vote
0
answers
30
views
File corruption after file copying using python, how to fix it?
The following code is used:
Python
import os
import shutil
def backup_files(src_dir, dest_dir):
for root, dirs, files in os.walk(src_dir):
for file in files:
src_file = os....
0
votes
0
answers
23
views
Errors decoding a binary image file using blob & window.btoa in tauri with Vue3
Demo:
components/imgDecode.vue:
<script setup>
import { nextTick, ref } from "vue";
import markdownIt from "markdown-it";
import { invoke, convertFileSrc } from '@tauri-apps/...
-1
votes
1
answer
34
views
ImportError: cannot import name '' from '' (unknown location)
This is my folder structure
folder structure
I want to import formatting into my jupyter notebook, main.ipynb.I have tried from src.processing import formatting
However, when I try the import, I get ...
0
votes
2
answers
26
views
python send InMemoryUploadedFile to requests.request
In postmen I send data like this:
My python code is:
headers = {
"Accept": "*/*",
"Content-Type": "multipart/form-data; boundary=...
0
votes
1
answer
23
views
Some random ownership changes through `rsync -a` inside a LXC container
I am migrating a dedicated server running Debian 12 with LXC and a couple of containers.
I use rsync with -avhze options from the new server (pulling), with root user on both sides.
It appears that ...
-1
votes
1
answer
41
views
How can solve error downloading file from my web in VBA?
I need to perform a function to download a file from a website. I have tested with the Public Declare PtrSafe Function URLDownloadToFile function and it does not work on my website http://pavimarcon....
-1
votes
0
answers
33
views
How can I create a file directory website [closed]
I am trying to create a website that is aimed at allowing the user to download a file from a directory/index of files on the website.
Is there a shortcut to creating a website like this from existing ...
0
votes
0
answers
26
views
Why does fstreams have 1 cursor for both read & write? (Logically and technically) [duplicate]
Consider the next code:
#include <iostream>
#include <fstream>
using std::fstream;
int main()
{
fstream file("text.txt", ios::out| ios::in |ios::trunc| ios::binary);
if (!file)
...
0
votes
1
answer
7
views
How to convert a hosted Adobe Illustrator file to a web-supported preview format?
My web application accesses adobe illustrator files from s3 object storage. I need to display a preview of these images. Web browsers don't support .ai files, so they need to be converted into a ...
0
votes
1
answer
11
views
How to upload a complete folder instead on files on my Next app?
I am creating a next app I am able to upload files using fileAPI , but I want to upload a folder and write a logic so that all the files (.text,.img,.pdf) inside the folder can be extracted can be ...
0
votes
0
answers
10
views
Reading MSG Native(.nat) file with satpy
I am trying to read an MSG (Meteosat Second Generation) file given in the native(.nat) format using satpy. I tried using:
import numpy as np
import os
from satpy import Scene
import matplotlib.pyplot ...
0
votes
1
answer
52
views
how can i copy the files to corresponding folders
i have over 30k+ pdf files in a folder and most of them in fact useless, so i want to filter which i want to use so i created folders named with those i need and then i am trying to copy .pdf and .stp ...
-2
votes
1
answer
64
views
Run python code in crontab: "File not found" error [closed]
If I run the python file directly there is no problem.
However, when running in crontab, error "File not found" occurs.
selenium.common.exceptions.InvalidArgumentException:
Message: invalid ...
0
votes
0
answers
42
views
getInfoAsync not working as expected - expo-file-system
I'm using expo v51 react-native, expo-file-system package. So, I want to get the information from files recursively inside a given directory, to get all the paths of files inside it and return:
const ...
0
votes
0
answers
7
views
Explorer crash on double cleicl on file to execute, but
I have got a new computer and I migrated all my file.
Some of files transfered crashes when double clcking or throwing the "open" command in the contextual menue.
When copying those file ...
1
vote
1
answer
40
views
Convert TSV file data to a dataframe, which can be pushed to database
We have TSV files which holds IOT data, want to convert to table like structure using pandas. I have worked on TSV data, similar to given below, were the logics goes like
read the file
Add new column ...
0
votes
0
answers
21
views
SAS IMPORT TABLE
I'm trying to import a file that have 833 lines but when I import it on SAS only appear 11 lines.
data shops;
length name$64 straat$64 pc6$8 plaats$32 pc4$8 Keten$32 Formule$32 niv1_ddms$8 ...
0
votes
1
answer
55
views
Python code unable to save to existing folder
I've been writing some code that takes a series of Excel files as an input, and then saves a dataframe to an excel as an output. Both the input and output folders sit on a network drive, where
...
0
votes
1
answer
23
views
How to get file from "file_picker" to upload in flutter web?
I need to upload a PDF file to the server.
I use this code.
void pickFiles() async {
try {
final result = await FilePicker.platform.pickFiles(
allowMultiple: false,
type: ...
0
votes
0
answers
10
views
Apache Pulsar to FileSink using pyflink
I'm reading from a pulsar source, doing some filtering and some transformations and then writing to files. I'm using 2 methods
Write to file using a map function - This provides files with the events ...
1
vote
1
answer
41
views
Why is the following behaviour observed while dealing with a text file object opened with 'r+' mode in Python?
I was going through file handling in Python and experimenting with different file modes. In a certain scenario with file mode as 'r+', I was unable to make sense of what was happening while using the ...
0
votes
2
answers
81
views
Bash: Reading in a string from a file with variable substitution
I have a weird situation where I have a command stored in a file and that file contains references to variables.
I'm able to read the file just fine, but I'm having trouble getting variable expansion ...
0
votes
0
answers
20
views
How to retrieve automatically/periodically the WSS urls that the tab/browser is using and save them to a file?
I'm looking to retrieve the WSS(WebSocket Secure) urls that the Firefox/Chrome browser(only 1 tab open) is using and store them to a file, as often as possible.
Is it possible to do this with minimal ...
0
votes
1
answer
42
views
Cannot Update User Profile in Flutter
I am a beginner in flutter development, i want to call the API to update the user profile, in the API one of them consist of 'image' & 'proof' field,that field can be left blank, but the problem ...
-1
votes
0
answers
57
views
Which way should slashes be? [duplicate]
im learning java and am curious about something. like with slashes in file paths. i know that im supposed to use / in the code. but what about when reading in a file path from another file? so like i ...
0
votes
0
answers
35
views
Check if ASCII/ text file is locked or being written [duplicate]
The title is pretty self-explanatory.
The commonly used method:
protected virtual bool IsFileLocked(FileInfo file)
{
try
{
using(FileStream stream = file.Open(FileMode.Open, FileAccess....
-1
votes
1
answer
104
views
Generating empty output file
I wrote a code for generating an output file in my system in C++. The function is getting executed, but the only problem is that the output file generated is empty. Can anybody please tell me what I ...
0
votes
0
answers
41
views
How to read a txt file in pandas where head fields are in lines? [duplicate]
I have a txt file like below, where some data have the ":" as value, and between each record there is two blank lines
Serial# : 356899
LDEV : 0
SL : 0
CL : 0
VOL_TYPE : OPEN-V-CVS
...
0
votes
1
answer
35
views
Wrong column formatting of CSV file output
My code is meant to transform a text file in the format below:
> gene name
gene sequence
to a csv file where in each row, 1 column has a gene name and other has a gene sequence.
However, some of ...
0
votes
0
answers
10
views
How can I Run/Extract/Or view a KPA file
I was coping files from a Dx3 VTech Watch and I found in the apps section a .kpa file and Im curious on how I can view it.
Ive noticed its a binary file
If you want to take a look at the files I ...
3
votes
2
answers
69
views
fwscanf failing to read UTF-8 CSV file correctly in C
This program can only use libraries of the C standard.
I'm trying to read a UTF-8 encoded CSV file in C using fwscanf, but I'm encountering issues with the reading process. The file contains rows with ...
-1
votes
1
answer
16
views
how to use more than one file in htaccess file?
I can't use more than one file in htaccess file for password protection
<Files "startside-int.html">
AuthType Basic
AuthName "Password Protected Area"
AuthUserFile "/...
0
votes
0
answers
30
views
Spark : Read special characters from the content of dat file without corrupting it in scala
I have to read all the special characters in some dat file (e.g.- testdata.dat) without being corrupted and initialise it into a dataframe in scala using spark.
I have one dat file (eg - testdata.dat),...
0
votes
2
answers
60
views
Comparing cell values in files with identical names
I have a process that exports two sets of identical Excel files - a first set where users can edit data and a second reference set that enables file compare to identify edits made in the first set. ...
1
vote
1
answer
55
views
File created with fmemopen has no contents after writing
I have some files on disk that I want to read in and concatenate. I don't want to create a new temporary file on disk. So I decided to use fmemopen to read/write to memory and access it using FILE ...
2
votes
0
answers
29
views
File() only returns one array element [duplicate]
I'm trying to read a copy of my servers firewall deny list into an array but only one array element is returned. Here is a part of the list:
46.229.168.0/24 # {do not delete} - Thu Nov 14 01:23:31 ...
1
vote
1
answer
32
views
How to import .db file to pgAdmin 4?
I want to import a file with .db extension into pgAdmin 4, how can I do that? It is not a .tar file but a .db file. Is there any way to import this database?
Thanks in advance for the help.
-1
votes
1
answer
23
views
How do you run a python script when an app runs
I was wondering if it is possible to run a certain python code I wrote when an app runs. I am on a Windows machine I don't want to keep some script running all the time on my computer that checks if a ...
0
votes
1
answer
48
views
search for files with reader permission in Google drive API if email is not a gmail
I'd like to know if it's possible to query files by permission in drive API only if the permission email is a gmail (and obviously an existing account)
$results = $service->files->listFiles()
...
0
votes
1
answer
27
views
Use flutter share_plus to open share sheet and prefill email
I want to be able to open share sheet (with all share options) and when I click email. it is prefilled.target email should be prefilled.
static Future<void> exportFile({
required ...
-2
votes
1
answer
54
views
My multi threaded rayon Rust loop can't outperform my Signlethreaded loop
I've been creating a function that is supposed to a BigUint into the base 1048576. I've been paralyzed by a problem I'm not quite sure how to solve.
I originally made a single threaded varient but on ...