Questions tagged [file-move]

Moving files in a filesystem.

Use this instead of tags like which are really vague.

132 questions
10
votes
6 answers

Flatten complex directory structure in Python

I want to move files from a complex directory structure to just one place. For example i have this deep hierarchy: foo/ foo2/ 1.jpg 2.jpg ... I want it to be: 1.jpg 2.jpg ... My current solution: def move(destination): …
Mirzhan Irkegulov
  • 17,660
  • 12
  • 105
  • 166
10
votes
2 answers

DbContext doesn't release SQLite database

First, these are my intentions: Create a DbContext on SQLite Read and write from/to it Close context Move the file to another location Points 1-3 work perfectly. The problem starts when I try to move the database. I get an error stating that:…
Teazl
  • 233
  • 3
  • 12
9
votes
2 answers

Moving a file using SetFileInformationByHandle

I'm trying to move a file using SetFileInformationByHandle. This technique has been proposed by Niall Douglas in his CppCon2015 talk "Racing The File System" as a way to atomically move/rename a file. However, I'm struggling to provide correct…
dyp
  • 38,334
  • 13
  • 112
  • 177
8
votes
3 answers

Create Git patches for two files across several renames

I want to move two files from one repository to another. The files were originally added as: /src/init/Price.cs /tests/init/PriceTests.cs The two files were later renamed to: /src/init/PriceValue.cs /tests/init/PriceValueTests.cs And then moved…
Asbjørn Ulsberg
  • 8,721
  • 3
  • 45
  • 61
6
votes
2 answers

Move files up one folder level

I have a folder called "April reports" that contains a folder for each day of the month. Each folder then contains another folder which contains PDF files: April reports ├─01-04-2018 │ └─dayreports │ ├─approved.pdf │ …
ellemgcf
  • 77
  • 1
  • 2
  • 7
6
votes
4 answers

System.IO.File.Move error - Could not find a part of the path

I have a sync software, which loads CSV files from "Incoming" folder, processes them and then moves them to the "Archive" folder. Today, I saw the following error with this sync software: [23/06/2014 00:06:04 AM] : Failed to move file…
Latheesan
  • 23,247
  • 32
  • 107
  • 201
4
votes
3 answers

Failed to get default debug keystore location

I changed my project default location in Android Studio Settings from /Documents/Android Studio projects to /Documents/AndroidProjects. Then I moved an existing project from former to latter in file explorer. Then I opened Android Studio and…
4
votes
1 answer

Rename non empty directory issue using Java NIO

According to: How do I rename (not move) a file in JDK7? I'm trying to rename folder name of not empty folder with java NIO My result , is new directory created without files inside and not delete old one. The code i used but it doesn't work: …
VitalyT
  • 1,671
  • 3
  • 21
  • 49
4
votes
3 answers

OS X 10.9 Applescript changes: using the `move` command in the "System Events" context to move a file

I went to run an old script and it broke after the 10.9 update. I used to move files with system events with the following code. set Somefilepath to "Design_005_HD:Users:Design_005:Desktop:Start:TextFile.txt" set somefolderpath to…
Tim Joe
  • 475
  • 8
  • 18
3
votes
4 answers

Recursively move all files on subdirectories to another directory in Python

The title explains what I am after. Note that the sub directories won't contain any directories only files (*.JPG). Essentially, just moving everything up one level in the file tree. For example, from ~/someDir/folder1/* , ~/someDir/folder2/* , ...…
Xlqt
  • 35
  • 1
  • 1
  • 4
3
votes
1 answer

Reading input and moving files with similar names

I am trying to create a script which reads the first line of a file and then moves all of files with a similar naming convention up a level. These are 3 example…
A.Watkins
  • 37
  • 5
3
votes
3 answers

file.Move without renaming it

Im coding a programm, which should read out the id3 tags of mp3 files, create a Directory named like the artist and then i want to move the mp3 files into the specific artist directory. When im trying to Move the Mp3 file, it doesnt move it into the…
Hansanho
  • 295
  • 1
  • 3
  • 13
2
votes
2 answers

Subversion: merge moved file

I've moved (renamed) a file in a local SVN directory: svn move src_file_path dst_file_path When I've tried to svn up, I got: D C src_file_path > local delete, incoming edit upon update This means someone else edited the file that I…
ranr
  • 169
  • 3
2
votes
1 answer

Is moving a file atomic if more than 1 directory is involved?

In NTFS, file moving is atomic as explained here: [...] if you are running under NTFS then file operations are atomic at the file system level. A rename will occur in a single operation as far as any higher code is concerned. Does this mean…
mafu
  • 31,798
  • 42
  • 154
  • 247
2
votes
1 answer

How to move files from multiple specific subfolders in the same directory?

I'm trying to do the same as in this question: Copy files from multiple specific subfolders. But none of the answers work for me at all. When I execute the py in my Windows cmd it doesn't even go into the loops, as I receive no print() line in the…
Simon
  • 53
  • 7
1
2 3
8 9