Unless a directory pre-existed in you home directory , the effect will likely have been that your original file was renamed to (a file with) the same name as your intended target directory.
So with "targetdirname" being the new name of the wrongfully renamed file:
should suffice to reverse the operation and rename it back to originalfilename.
Hi ,
I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory.
how to write this in a simple script, I have made my code complex
if ; then
taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Hello all,
Here's the deal...I have one directory with many subdirs and files.
What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file.
A script for... (5 Replies)
how is it possible for a directory to be empty and still have a size greater than 0 in bytes...
i made a shell script that shows info about all files/directories and this is what came up
the last one is the size, here its showing 1024
in the for loop i did something like
for h in * .*; do
... (4 Replies)
Since I'm usually on windows I've came across different shells like Cygwin, Hamilton, and MKS. I've been working in csh most of the time, so porting scripts from one shell to another can be fairly annoying and confusing.
When specifying a directory I noticed that certain shells do not recognize... (1 Reply)
Hi all,
Using grep command, i want to find the pattern of text in all directories and sub-directories.
e.g: if i want to search for a pattern named "parmeter", i used the command
grep -i "param" ../*
is this correct? (1 Reply)
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
It is for HP-Unix B.11.31.
Requirement:
1. List the directories, having given pattern in the directories name, sorted by creation date.
Example: Directories with name "pkg32*" or "pkg33*"
2. On the output of 1. list the directories by creation date as sort order, with creation date... (2 Replies)
Hi,
First server every thing is working but keeps crashing so to be on the safe side created second server and moved all the files. But I notice there is a " dot " at the end. See below. Not sure what that means. Also getting 403 on Apache. Please see below. Thanks you so much.
ls -l... (4 Replies)
I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies
LEARN ABOUT SUSE
vop_rename
VOP_RENAME(9) BSD Kernel Developer's Manual VOP_RENAME(9)NAME
VOP_RENAME -- rename a file
SYNOPSIS
#include <sys/param.h>
#include <sys/vnode.h>
int
VOP_RENAME(struct vnode *fdvp, struct vnode *fvp, struct componentname *fcnp, struct vnode *tdvp, struct vnode *tvp,
struct componentname *tcnp);
DESCRIPTION
This renames a file and possibly changes its parent directory. If the destination object exists, it will be removed first.
Its arguments are:
fdvp The vnode of the old parent directory.
fvp The vnode of the file to be renamed.
fcnp Pathname information about the file's current name.
tdvp The vnode of the new parent directory.
tvp The vnode of the target file (if it exists).
tcnp Pathname information about the file's new name.
LOCKS
The source directory and file are unlocked but are expected to have their ref count bumped on entry. The VOP routine is expected to vrele(9)
both prior to returning.
The destination directory and file are locked as well as having their ref count bumped. The VOP routine is expected to vput(9) both prior to
returning.
ERRORS
[EPERM] The file is immutable.
[EXDEV] It is not possible to rename a file between different file systems.
[EINVAL] An attempt was made to rename . or .., or to perform an operation which would break the directory tree structure.
[ENOTDIR] An attempt was made to rename a directory to a file or vice versa.
[ENOTEMPTY] An attempt was made to remove a directory which is not empty.
SEE ALSO vnode(9)AUTHORS
This manual page was written by Doug Rabson.
BSD July 24, 1996 BSD