Questions tagged [directory]
A directory or folder is a container within a digital file system, in which groups of computer files and other directories can be kept and organized.
19,133
questions
0
votes
0
answers
9
views
Operation not permitted and shutil.rmtree
I have a Python script that creates folders and files in them (folders and files have the root user and group). When the script tries to delete files or folders (shutil.rmtree(path/to/root_folder)) an ...
-1
votes
1
answer
15
views
How to append multiple directories then screenshot each directory one by one using Python
Right now, I have only one directory which will launch on the screen after launching the cmd
app = application.Application().start(r'c:\WINDOWS\System32\cmd.exe /k', create_new_console=True, ...
0
votes
2
answers
18
views
Find the newest folder in a directory with NodeJS
I need to find a way to get the newest folder created in a directory. Usually there are 3-5 different folders inside of a folder, and I want to find the newest one either by folder name (newest ...
0
votes
0
answers
14
views
Powershell script for bulk action
I am in need of help making the below script import a csv of users firstname and last and then setting the same account expiration inside of AD using the DRA powershell extension. The section "CN=...
0
votes
0
answers
7
views
monitor different folders with respective patterns in watchdog
I want to monitor different folders with respective patterns in watchdog.
For example: The folder structure and file are as shown in below:
--> /develop/folder1t/folder2s/folder3r
...
1
vote
0
answers
21
views
GCP & Terraform: How to find a specific google folder with random suffix in terraform?
I have the following issue:
As deleted resources vanish only after 30 days, I add random suffixes as part of gcp folder names.
Now in order to find and select the according folder for deploying shared ...
0
votes
0
answers
12
views
.NET Windows forms app: set project installation directory and editable configuration file
How can I force an installation directory in a .NET Windows forms app? By default the installer installs in random weird directories.
Could I force for example a subdirectory in "Program Files&...
-1
votes
2
answers
20
views
How do I use flask render_template from a different directory [duplicate]
I need some help. Let me explain my situation. Let's assume that the main flask project is in ~/project as an example. Now the directory structure looks like
main.py
templates
inside of templates ...
0
votes
0
answers
6
views
npm config set prefix returns "/Users/user/.npm-global" yet globally installed packages still aren't showing up
Been dealing with EACCESS errors so I followed the steps here: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally
Now npm config set prefix returns /Users/...
0
votes
0
answers
22
views
Win Task Scheduler generates multiple folders instead a zip file
I want to zip a project folder each month, programmed in a task scheduler executing a .bat file with the following script:
@echo off
set backuptime=%date:~4,2%-%date:~7,2%-%date:~10,4%
"C:\...
0
votes
2
answers
30
views
How to create a complete text file from clob column in table
I have the problem that when I create the text file it only saves the first 32768 bytes but the file is larger and the rest of the information does not appear in the file.
This is the code in plsql ...
0
votes
1
answer
27
views
List of files in a certain directory that have a certain string in the name
So I started python today and can't rly go through some chaos I encountered on the internet for this topic.
Many solutions a I try with os.walk and glob don't work - I of course assume that's because ...
-1
votes
2
answers
20
views
Find non empty directories with condition on their names in linux
There's a directory that has several subdirectories. These subdirectories' names are the date that the subdirectory was created. Now I want to list the subdirectories created in 'June' of 2021 and are ...
2
votes
6
answers
53
views
Python count files in a directory and all its subdirectories
I am trying to count all the files in a folder and all its subfolders
For exemple, if my folder looks like this:
file1.txt
subfolder1/
├── file2.txt
├── subfolder2/
│ ├── file3.txt
│ ├── file4.txt
...
2
votes
1
answer
24
views
Rename certain subfolders in a directory using python
I have a folder structure that looks something like this:
/Forecasting/as_of_date=20220201/type=full/export_country=Spain/import_country=France/000.parquet'
and there are approx 2500 such structures.
...
0
votes
0
answers
11
views
Kotlin atomic copy folder
I want to copy a folder over another, but want to achieve it atomically, i.e. if any error happens, it will recover the folder to its original state. Something is similar to Kotlin Atomic file
0
votes
1
answer
42
views
Opening a file with Python in the browser [duplicate]
I am doing a project with an html, js and css front-end and a python back-end.
I linked back-end and front-end with the py-script library.
I have to open a json file with the python script and it ...
-2
votes
0
answers
17
views
Why do I receive a "no such file or directory" error when opening path?
Here's the code:
from pathlib import Path
path1=Path(r"Users\me\Desktop\Python\Files\mbox-short.txt")
fhand=open(path1)
I receive a 'no such file or directory' error.
0
votes
1
answer
31
views
How can I count subfolders in a Batch file
I need the count of the longest path in my folder and put it in a variable. Because when I remove recursively subfolders I have to do it multiple times to check if there is other empty folders.
FOR /l ...
0
votes
3
answers
29
views
Python - Trying to extract lines containing a key word from multiple files in a directory
I am trying to build a script which can look for all files in a certain folder, and pull any lines of text that contain a key word or phrase.
Very new to python, and not really understanding how to ...
-1
votes
0
answers
22
views
Set Folder Name to Variable [duplicate]
I am trying to set a folder name to a variable and trying the following command but it is not working.
e.g --> Folder_Name = Book
CMD
@ECHO ON
set directoryName=dir /b
echo %directoryName%
...
2
votes
0
answers
21
views
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 getting the error shown below.
Here ...
-1
votes
1
answer
32
views
diff compare directories by filename only
Is it possible to use any sort of diff utility to diff based on filename only, excluding the file extensions? I have multiple dirs that have various versions of a file, ie media.mov, media.mp4, media....
0
votes
0
answers
70
views
Weird characters on creating a ftp folder via VBA
I am asking the first question on this site because I'm stuck in a problem.
Sorry for my bad English.
I'm creating a DataBase with some coding on VBA.
Some days ago I wrote some code which creates a ...
0
votes
1
answer
12
views
using python, get a list of directories for parallel script execution
I need to be able to get a list of directories with the following pattern:
/app/{APP_NAME}/current/bin
in order to run start and stop scripts. The problem I run into is that, depending on the node, ...
0
votes
1
answer
7
views
How to organize classes and layout
so i was trying to find how to make sub folders for java classes and the xml layouts, I have a big project to work on and having to many classes and layouts in 1 folder makes it messy, is there a ...
-1
votes
0
answers
16
views
How to create a directory on linux whose owner and/or group is root [closed]
I'm new to linux and very unfamiliar with using this
let me ask you a few questions
How to create a directory in linux whose owner and/or group is root?
Am I logged in as root or user?
What is the ...
0
votes
1
answer
33
views
How to make path using pandas dataframe as reference
I plan to make hundreds of dataframe with using Excel in hundreds of folders.
Reference table:
Folder Category Sub Category
205 News and Media ...
2
votes
1
answer
29
views
Apply a file to multiple folders using better PowerShell script
I'm working on a project where I have to apply a file to multiple folders every so often. I'm trying to learn some PowerShell commands to make this a little easier. I came up with the following ...
0
votes
2
answers
30
views
Checking if an image of a certain type (png) exists in a directory in Python [duplicate]
I'm wondering how can I check in a certain directory if it has a png image(it's name can be anything). If yes, then save the name of the images in a list.
Thanks
-1
votes
0
answers
41
views
Rename folder java
I've been struggling with renaming a directory with directories/files in Java. I tried using this approach:
File oldDir = new File("path/to/oldDir");
File newDir = new File("path/to/...
-1
votes
0
answers
13
views
Sendkeys does not work for uploading a folder in selenium c# in headless mode
The code is working fine in normal mode and it silently uploads the entire folder yet when executed in headless mode it does nothing. Just execute the line and move to the next line.
I am using the ...
0
votes
0
answers
6
views
How do I link out of one folder and into another using the href tag?
I'm having a bit of trouble linking out of my folder into another, I have tried to use the
../ and /
but that doesnt work for some reason, here is my code.
<div class="collapse navbar-...
0
votes
0
answers
12
views
Security issues and suddenly all folders are locked [closed]
So, i'm using mint xfce 20.3 una, and suddenly all of my folders are locked. Documents, musics, photos, home, everything is locked.
Should i concern about security issues??
Why this happened suddenly?
...
0
votes
0
answers
30
views
Why doesnt my JSON file popup in my working directory when I run my function?
The idea is for a JSON file to be created in the working directory with configured inputs in the funct function below. But the file is not created in the working directory with tag w. Any Idea as to ...
0
votes
0
answers
22
views
Python how to copy directory/file with different username
I need to copy different files or directories to my USB device on a different computer, each computer has a different session name example :
Computer 1 = toto Computer 2 = titi Computer 3 = qwerty
on ...
0
votes
1
answer
36
views
Working with timestamps from jpg.filename
I have a folder ("pictures") with many jpg.files with the filename as timestamp (e.g. "09_02_01.jp" or "10_04_01.jpg").
Now I want to iterate through the folder and all ...
0
votes
0
answers
13
views
Lock current working directory in subprocess? or make cwd as home directory
simply I am using windows 10 operating system and run code in python as
main.py
cmd = "python example.py"
sp = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE,...
0
votes
0
answers
21
views
How do I access a protected network directory on Windows?
I am trying to copy files from a network path like this:
//com.example.corp/example/data/test/copy_dir
to my local drive using Python 3.9 on a Windows machine.
The tricky thing is that I had to make ...
0
votes
0
answers
12
views
Python: change user password in csv file
In my current code I'm able to register a new account consisting of a e-mail and password, login and reset the password of the account. But my code has a big problem: whenever I want to change the ...
0
votes
0
answers
15
views
How to format tkinter filedialog.askdirectory() Path to work similar to a hardcoded filepath?
I am using the following code to retrieve the directory path:
from tkinter import filedialog
from tkinter import *
root = Tk()
root.withdraw()
input_folder = filedialog.askdirectory()
And try to ...
-1
votes
0
answers
14
views
How can I delete this folder? (Error: The file cloud provider is not running)
How can I delete this folder? (Error: The file cloud provider is not running)
I want to delete this folder, but I can't because it was once synchronized with Onedrive, but not anymore as I uninstalled ...
-1
votes
1
answer
41
views
How To Copy Or Move Folders From One Folder To Another Based On A List In Excel?
I have a list of 346 folders in Excel, that refers to 346 folders out of 10.000 total folders in the working directory.
I want to copy/move only the specified 346 folders (out of 10.000) to a new ...
0
votes
1
answer
17
views
Is it possible to save file locations in Visual Studio Code to navigate between folders?
I have a Visual Studio Code project with lots of files in lots of subfolders. As I am working on my code I need to navigate back and forth through all of these different (sub-)locations which is very ...
0
votes
1
answer
15
views
How to create directory in remote system using python script
I want to create a directory in my remote system using python script or by socket programming. I have remote system's Username, password and IP address. I am able to do this in my local machine but ...
0
votes
1
answer
17
views
absolute file reference path not recognizing "\b" in subfolder "\bobby" of my file reference string as text
apologies if this has been asked before. I am currently learning to read/write to files using absolute referencing in Python. I am unfortunate enough to be named Bobby - meaning that my absolute ...
0
votes
1
answer
25
views
Loop over images in directories/Subdirectories for data processing
I am trying to do image processing on my dataset. The dataset is divided into 346 folders according to the following manner
What I want to do is
loop over the 346.
Enter each folder and process the ...
0
votes
1
answer
39
views
Permission denied when creating directory
So I would like to create a directory in $HOME but then it says permisson denied, how does creating directories in $HOME require permissions?
Here's the code
let mut dir = home::home_dir().expect(&...
1
vote
1
answer
37
views
Version strings to "System.Version" too long (or short) in PowerShell
How can I force conversion to type System.Version in PowerShell, or more likely, better understand why I cannot arbitrarily assign number strings type System.Version?
We ingest some software updates ...
0
votes
1
answer
39
views
Delete all files without deleting folders
I have a folder named (top) with 10 folders named 1,2,3,4,5,6,7,8,9, and 10.
Inside the top folder I have files, too (are not folders).
I can list all the files x = os.listdir(path).
How can I delete ...