Questions tagged [rename]

For anything regarding renaming. Could be applicable to a wide range of subjects. Should be replaced by a more domain-specific tag if applicable.

Questions regarding renaming one or many files, directories, projects, variables, users, data cells, and version control conflicts arising from renaming should be tagged with rename.

To rename a file means to give an existing file a new name without changing any of its content. In UNIX systems, this is done with the mv command.

Renaming a variable will usually require a find-and-replace edit in existing code.

5438 questions
36
votes
3 answers

Is rename() without fsync() safe?

Is it safe to call rename(tmppath, path) without calling fsync(tmppath_fd) first? I want the path to always point to a complete file. I care mainly about Ext4. Is the rename() promised to be safe in all future Linux kernel versions? A usage example…
Ivo Danihelka
  • 3,382
  • 3
  • 31
  • 27
36
votes
2 answers

Override a pytest parameterized functions name

My parameters determine the name of my parameterized pytest. I will be using a some randomized params for these tests. In order for my reporting names in junit to not get messed up, I'd like to create a static name for each parameterized test. Is it…
SomeGuyOnAComputer
  • 5,414
  • 6
  • 40
  • 72
36
votes
8 answers

Get the Perl rename utility instead of the built-in rename

Many sites (including various SO articles) talk about using "rename" using Perl expressions to rename files. This would be perfect, but apparently this is not the rename utility I have, and none of these articles seem to comprehend that there are…
WorldsEndless
  • 1,493
  • 1
  • 15
  • 27
35
votes
3 answers

is it possible to change sheet name with apache poi MS excel java android

is there any way to update existing sheet name of MS Excel file knowing that I am using apache poi in my android app I can create a sheet with my custom name HSSFSheet sheet = workbook.createSheet("my custom name"); but when I want to copy…
funfordevelopping
  • 383
  • 1
  • 3
  • 7
35
votes
10 answers

Rename multiple files in cmd

If I have multiple files in a directory and want to append something to their filenames, but not to the extension, how would I do this? I have tried the following, with test files file1.txt and file2.txt: ren *.txt *1.1.txt This renames the files…
Morne
  • 1,623
  • 2
  • 18
  • 33
35
votes
2 answers

Strange [number]s in Delphi DFM files - origin and necessity?

I need to change a large number of Delphi components defined in one package to similar ones in another package. Much of the grunt work can be done by replacing text (component types and properties) in the DFM files - saved as text of course. I have…
Jan Doggen
  • 8,799
  • 13
  • 70
  • 144
35
votes
4 answers

Rename or remove prefix for multiple files to each ones' number in Windows

I am trying to change all the files names in a current folder and I am trying to achieve this either by removing the files prefix (every file has a common prefix) or changing their names to their count (if there are 5 files, the filenames will be…
Shadow
  • 4,168
  • 5
  • 41
  • 72
33
votes
1 answer

Batch File - Remove Second File Extension

Using a batch file is there a way that I can strip off the .deploy extension from all files in a directory. For example 1.txt.deploy => 1.txt 2.txt.deploy => 2.txt etc
David Ward
  • 3,739
  • 10
  • 44
  • 66
33
votes
5 answers

Renaming applications in IIS 7.0

It's generally known that you are not allowed to edit the application alias while editing application settings through window interface of IIS Manager. The alias of an application has the gray color (not admitted to change). But in this article you…
troublemaker
  • 331
  • 1
  • 3
  • 3
33
votes
5 answers

How do I move file a to a different partition or device in Node.js?

I'm trying to move a file from one partition to another in a Node.js script. When I used fs.renameSync I received Error: EXDEV, Cross-device link. I'd copy it over and delete the original, but I don't see a command to copy files either. How can this…
Jeremy
  • 1
  • 85
  • 340
  • 366
33
votes
6 answers

Renaming an app with Django and South

I am renaming an application to a more suitable name. In doing so, I want to ensure that South properly migrates the database (renames database tables and changes references in django_content_type or south_migrationhistory). I know how to migrate…
Trey Hunner
  • 10,975
  • 4
  • 55
  • 114
33
votes
8 answers

Python: Rename duplicates in list with progressive numbers without sorting list

Given a list like this: mylist = ["name", "state", "name", "city", "name", "zip", "zip"] I would like to rename the duplicates by appending a number to get the following result: mylist = ["name1", "state", "name2", "city", "name3", "zip1",…
panofish
  • 7,578
  • 13
  • 55
  • 96
32
votes
4 answers

Renaming TFS2010 Team Project

Is it possible to rename a TFS2010 team project? The project in question is based on the CMMI 5.0 team project template, but it has been modified with several custom modifications (new WITs and link types). For a rename to be feasible, all history…
havardhu
  • 3,576
  • 2
  • 30
  • 42
31
votes
2 answers

Showing renames in hg status?

I know that Mercurial can track renames of files, but how do I get it to show me renames instead of adds/removes when I do hg status? For instance, instead of: A bin/extract-csv-column.pl A bin/find-mirna-binding.pl A…
Ryan C. Thompson
  • 40,856
  • 28
  • 97
  • 159
31
votes
2 answers

Rename a single pandas DataFrame column without knowing column name

I know I can rename single pandas.DataFrame columns with: drugInfo.rename(columns = {'col_1': 'col_1_new_name'}, inplace = True) But I'd like to rename a column based on its index (without knowing its name) - although I know dictionaries don't have…
afrendeiro
  • 2,423
  • 2
  • 23
  • 22