aboutsummaryrefslogtreecommitdiff
path: root/bin/mv
Commit message (Collapse)AuthorAgeFilesLines
* Check if fchflags() is needed by fstat'ing before and checkXin LI2014-07-011-4/+13
| | | | | | | | | | the results. Reviewed by: jilles X-MFC-With: r267977 Notes: svn path=/head/; revision=268129
* Always set UF_ARCHIVE on target (because they are by definition new filesXin LI2014-06-271-2/+2
| | | | | | | | | | and should be archived) and ignore error when we can't set it (e.g. NFS). Reviewed by: ken MFC after: 2 weeks Notes: svn path=/head/; revision=267977
* Use src.opts.mk in preference to bsd.own.mk except where we need stuffWarner Losh2014-05-061-1/+1
| | | | | | | from the latter. Notes: svn path=/head/; revision=265420
* Make bsd.test.mk the only public mk fragment for the building of tests.Julio Merino2014-03-141-1/+1
| | | | | | | | | | | | | | | | | Change {atf,plain,tap}.test.mk to be internal implementation details of bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk and declaratively specify what they want to build, without worrying about the internal implementation of the mk files. The reason for this change is to permit building test programs of different interfaces from a single directory, which is something I had a need for while porting tests over from src/tools/regression/. Additionally, this change makes it possible to perform some other requested changes to bsd.test.mk in an easier manner. Coming soon. Notes: svn path=/head/; revision=263161
* Migrate tools/regression/bin/ tests to the new layout.Julio Merino2013-12-113-0/+311
| | | | | | | | | | | | | | | | | | | | | | | This change is a proof of concept on how to easily integrate existing tests from the tools/regression/ hierarchy into the /usr/tests/ test suite and on how to adapt them to the new layout for src. To achieve these goals, this change: - Moves tests from tools/regression/bin/<tool>/ to bin/<tool>/tests/. - Renames the previous regress.sh files to legacy_test.sh. - Adds Makefiles to build and install the tests and all their supporting data files into /usr/tests/bin/. - Plugs the legacy_test test programs into the test suite using the new TAP backend for Kyua (appearing in 0.8) so that the code of the test programs does not have to change. - Registers the new directories in the BSD.test.dist mtree file. Reviewed by: freebsd-testing Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=259210
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typePawel Jakub Dawidek2013-03-211-1/+1
| | | | | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=248597
* Add a few examples.Joel Dahl2013-03-151-1/+11
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=248342
* Follow the behavior as specified in POSIX:Eitan Adler2012-11-151-1/+1
| | | | | | | | | | | | | | | | if (exists AND (NOT f_option) AND ((not_writable AND input_is_terminal) OR i_option)) prompt in particular, add the test for input_is_terminal PR: bin/173039 Submitted by: Mark Johnston <markjdb@gmail.com> Approved by: cperciva MFC after: 3 days Notes: svn path=/head/; revision=243072
* Add a -h flag similar to the -h flag for ln to force mv(1) to treat aJohn Baldwin2012-08-312-6/+36
| | | | | | | | | | | | symbolic link to a directory for the target as a symbolic link instead of a directory. This makes it possible to atomically update a symbolic link using rename(). Reviewed by: gj MFC after: 2 weeks Notes: svn path=/head/; revision=239951
* Put some static keywords in the source code.Ed Schouten2011-10-311-1/+1
| | | | | | | | | For these simple utilities, it doesn't harm to make all global variables static. In fact, this allows the compiler to perform better forms of optimisation and analysis. Notes: svn path=/head/; revision=226961
* Don't chop IO into small pieces, follow cp(1) and just use MAXPHYS.Ivan Voras2011-10-031-15/+9
| | | | Notes: svn path=/head/; revision=225954
* Add NFSv4 ACL support to mv(1).Edward Tomasz Napierala2009-09-041-12/+58
| | | | | | | Reviewed by: rwatson Notes: svn path=/head/; revision=196841
* Staticify symbols that will not be used in otherXin LI2008-07-191-11/+11
| | | | | | | places. Notes: svn path=/head/; revision=180604
* - Roll-back attempts to mimic rename(2) atomicity introduced in 1.47,Diomidis Spinellis2007-12-271-95/+69
| | | | | | | | | | | | | | | | | and follow the letter of the POSIX specification. - Moving a directory to an existing non-empty directory will now fail, as required. - Improve consistency and remove some style bugs of earlier versions. This version passes all tests of tools/regression/bin/mv/regress.sh 1.6 Reviewed by: bde MFC after: 1 month Notes: svn path=/head/; revision=174935
* Calling any function from vfork other than exec* and _exit yieldsDiomidis Spinellis2007-12-171-3/+9
| | | | | | | | | undefined behavior. Noted by: alfred Notes: svn path=/head/; revision=174709
* Eliminate gcc "variable clobbered" warnings by declaring the variablesDiomidis Spinellis2007-12-161-1/+2
| | | | | | | | | living across the vfork as volatile. Noted by: kan Notes: svn path=/head/; revision=174667
* When moving a directory across devices to a place where a directoryDiomidis Spinellis2007-12-161-22/+82
| | | | | | | | | | | | | | | | | | | | with the same name exists, delete that directory first, before performing the copy. This ensures that mv(1) across devices follows the semantics of rename(2), as required by POSIX. This change could introduce the potential of data loss, even if the copy fails, violating the atomicity properties of rename(2). This is (mostly) mitigated by first renaming the destination and obliterating it only after a succesfull copy. The above logic also led to the introduction of code that will cleanup the results of a partial copy, if a cross-device copy fails. PR: bin/118367 MFC after: 1 month Notes: svn path=/head/; revision=174664
* Bump document date on behalf of previous revision.Ruslan Ermilov2007-11-011-1/+1
| | | | Notes: svn path=/head/; revision=173248
* Replace a fairly opaque sentence with a much clearer wording from NetBSD.Pav Lucistnik2007-05-121-2/+2
| | | | | | | | | PR: docs/101330 (inspired by) Submitted by: Peter Gildea <peter@gildea.com> Obtained from: NetBSD Notes: svn path=/head/; revision=169510
* Attempt to complete the userspace integration of POSIX.1e extended ACLs.Christian S.J. Peron2005-09-051-1/+18
| | | | | | | | | | | | | | | | | This includes adding support for ACLs into cp(1) and mv(1) userspace utilities. For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination operands, the destination file's ACLs shall reflect the source. For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination operands, and -p has been specified, the ACLs from the source shall be preserved on the destination. MFC after: 1 month Notes: svn path=/head/; revision=149790
* Correct a few places where we called warn() when warnx() should haveMaxime Henrion2005-05-191-4/+4
| | | | | | | | | | been used. Submitted by: "Liam J. Foy" <liamfoy@sepulcrum.org> Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146418
* Add the new standard EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-161-5/+5
| | | | | | | Sort standard sections in the (documented) preferred order. Notes: svn path=/head/; revision=140353
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-102-1/+2
| | | | Notes: svn path=/head/; revision=139969
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-062-8/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* When symbolic link is pointed onto a mount point, it can't be movedPawel Jakub Dawidek2004-03-211-6/+17
| | | | | | | | | | | | to a different file system. Patch in PR was incorrect. PR: bin/64430 Submitted by: Samuel Tardieu MFC after: 3 days Notes: svn path=/head/; revision=127272
* Centralize _PATH_* definitions.David E. O'Brien2003-05-052-39/+0
| | | | | | | Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me) Notes: svn path=/head/; revision=114763
* Quiet warnings about copyright[].David E. O'Brien2003-05-011-2/+2
| | | | Notes: svn path=/head/; revision=114433
* Grammar fix.Giorgos Keramidas2002-08-261-1/+1
| | | | | | | | | PR: docs/42021 Submitted by: Jeff Ito <jeffi@rcn.com> MFC after: 3 days Notes: svn path=/head/; revision=102434
* s/filesystem/file system/ as discussed on -developersTom Rhodes2002-08-211-1/+1
| | | | Notes: svn path=/head/; revision=102230
* mdoc(7) police: tidy up, bump document date on behalf of the -n option.Ruslan Ermilov2002-08-091-9/+9
| | | | Notes: svn path=/head/; revision=101571
* Update usage for the addition of -n in rev 1.35 of mv.c.Johan Karlsson2002-07-092-3/+3
| | | | | | | Approved by: obrien, sheldonh (mentor). Notes: svn path=/head/; revision=99678
* When trying to emulate a cross-device move operation with cp and rm, addTim J. Robbins2002-06-161-2/+2
| | | | | | | | | | | | a "--" argument after the options so filenames with leading dashes are handled correctly. PR: 39318 Submitted by: Serge van den Boom <svdb@stack.nl> MFC after: 1 week Notes: svn path=/head/; revision=98280
* Remove local definition of _PATH_CP, and use <paths.h>, _PATH_CP is in theJuli Mallett2002-05-172-1/+1
| | | | | | | CURRENT <paths.h>. Notes: svn path=/head/; revision=96806
* Consistancy check s/file system/filesystem/Tom Rhodes2002-05-161-1/+1
| | | | | | | Reviewed by: brian Notes: svn path=/head/; revision=96702
* Update SCM ID.David E. O'Brien2002-03-221-2/+2
| | | | Notes: svn path=/head/; revision=92974
* Note that -n is non-standard.David E. O'Brien2002-03-221-1/+3
| | | | Notes: svn path=/head/; revision=92973
* Add the -n option, which automatically answers "no" to the overwrite question.David E. O'Brien2002-03-222-6/+27
| | | | Notes: svn path=/head/; revision=92935
* Warnings fixes.Mark Murray2002-02-221-1/+2
| | | | Notes: svn path=/head/; revision=91085
* Move user_from_uid to pwd.hWarner Losh2002-02-141-0/+2
| | | | | | | | | | | | | | | | Move group_from_gid to grp.h Remove from stdlib.h Make the prototypes match the code Fix rm and mv to include new files. NetBSD has these defined in those files, and others too that I've not done. Approved by: terminal room kabal Reviewed by: jhb, phk Notes: svn path=/head/; revision=90644
* missed a few registersWarner Losh2002-02-021-3/+3
| | | | Notes: svn path=/head/; revision=90114
* o __P has been reovedWarner Losh2002-02-021-16/+9
| | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Notes: svn path=/head/; revision=90110
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyDavid E. O'Brien2001-12-041-1/+0
| | | | | | | | | set WARNS=0. Reviewed by: mike Notes: svn path=/head/; revision=87323
* mdoc(7) police: utilize the new .Ex macro.Ruslan Ermilov2001-08-151-3/+1
| | | | Notes: svn path=/head/; revision=81687
* Set WARNS=2 on programs which compile cleanly.Dima Dorfman2001-07-151-0/+1
| | | | | | | Submitted by: Mike Barcroft <mike@q9media.com> Notes: svn path=/head/; revision=79758
* Remove whitespace at EOL.Dima Dorfman2001-07-151-1/+1
| | | | Notes: svn path=/head/; revision=79754
* Fix the type of the NULL arg to execl()Brian Somers2001-07-091-2/+3
| | | | | | | Idea from: Theo de Raadt <deraadt@openbsd.org> Notes: svn path=/head/; revision=79452
* Use PATH_MAX in preference to MAXPATHLEN.Warner Losh2001-05-291-3/+4
| | | | Notes: svn path=/head/; revision=77409
* Silence WARNS=2 and BDECFLAGS on alpha and i386, except for mode_tKris Kennaway2001-05-201-7/+8
| | | | | | | | | warnings. MFC after: 1 week Notes: svn path=/head/; revision=76878
* mdoc(7) police: use the new features of the Nm macro.Ruslan Ermilov2000-11-201-2/+2
| | | | Notes: svn path=/head/; revision=68935
* Don't emit a warning message if fchflags() returns EOPNOTSUPPSADA Kenji2000-07-201-1/+10
| | | | | | | | Requested by: FUJISHIMA Satsuki <k5@cheerful.com> Obtained from: OpenBSD Notes: svn path=/head/; revision=63680