Sponsored Content
Top Forums Programming chmod:No such file or directory Post 302346054 by mansa on Friday 21st of August 2009 12:33:47 AM
Old 08-21-2009
chmod:No such file or directory

Code:
  sprintf(fname, "core.%d", pid);
  (void) unlink(fname);
  if (ttrace(TT_PROC_CORE, pid, 0, 0, 0, 0) != 0) {
    perror("TT_PROC_CORE pass");
    Fail();
  }
  if (chmod(fname, 0) != 0) {
    perror("chmod");
    Fail();
  }

Hi,

If i execute above code,everytime am getting below error..


===============
STANDARD OUTPUT:
FAIL
STANDARD ERROR:
chmod: No such file or directory
===============


Could you please let me know how to overcome that issue..
Is there anything wrong in the code..

Thanks in Advance,
Mansa
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

directory permissions and CHMOD

I am working on a new UNIX box that has been delivered to us, and noticed that the /home directory has 555 permissions on it (dr-xr-xr-x). Any attempt to create write permissions fails on this directory (such as chmod 777), responding only with a message; chmod: WARNING: can't change home ... (3 Replies)
Discussion started by: ncarmstrong
3 Replies

2. UNIX for Dummies Questions & Answers

what to chmod to write in a directory?

i am unable to write to some .php files in the following directory: drwxr-xr-x 3 headroom max 448 Jun 6 2004 Docs i already tried this: chmod +777 Docs chmod: changing permissions of `Docs': Operation not permitted thanks for your help! (2 Replies)
Discussion started by: phonedog365
2 Replies

3. UNIX for Dummies Questions & Answers

chmod erased a directory(?)

I was attempting to change permissions on a directory, used a 'chmod -rwrwrw DirectoryName' command, and hit enter. Now, that directory shows that it's empty! How could this be? Any Ideas? Thanks (1 Reply)
Discussion started by: SmooBG
1 Replies

4. Shell Programming and Scripting

use a file to chmod

Hi! I need help becouse I've server to backup and I've a lot of files with 700 permission and I need to change the mode to 755 before copy So the point is. With find . -perm 700 -exec echo {} > textfile.txt \; I got a text file with 3156 line which one... (3 Replies)
Discussion started by: ruben.rodrigues
3 Replies

5. Solaris

Unable to chmod a file/directory

This is Solaris 10, by the way. I am aware of ACLs or something like that in Solaris 10 where you can change who can access directories and such that goes beyond the standard permisisons (chmod and rwxrwxrwx). Although I thought when these were being used, the permissions listing would show a... (12 Replies)
Discussion started by: lyonsd
12 Replies

6. UNIX for Dummies Questions & Answers

chmod of remote file

I would like to chmod the file which I am pulling from remote server onto my server. I am using the following script: sftp <server detail> get abc xyz chmod 666 xyz bye Though I could fetch the file successfully but I am not able to change the permission of xyz file on my server. umask... (1 Reply)
Discussion started by: kdtrica
1 Replies

7. Shell Programming and Scripting

File permission by chmod

Hi, I have a typical problem. Consider the scenario: Folder1 ------> Folder2 ------> File1 ------> Folder3 Above is my folder structure, currently the user group "other" has no permissions. I wish to give "read" permission for "others" to File1 using a single command. chmod -R... (5 Replies)
Discussion started by: animesh303
5 Replies

8. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

9. Red Hat

chmod only immediate directory?

I am having trouble figuring out how to do a "chmod o-w" for all files under a certain directory, while excluding directories under that certain directory. I can do chmod -R o-w /thisdirectory but that changes permissions of all directories under the directory as well as files. I just... (2 Replies)
Discussion started by: austinharris43
2 Replies

10. Shell Programming and Scripting

excluding a directory with chown, chmod

does anyone know how to exclude a directory with chown or chmod? im trying to do something like this chown $username:$username $directory/* chown $username:$username $directory/.* chown $username:$username $directory and find $directory/* -type f -exec... (1 Reply)
Discussion started by: vanessafan99
1 Replies
mcxmap(1)							  USER COMMANDS 							 mcxmap(1)

  NAME
      mcxmap - permute or remap the indices of graphs and matrices.

  SYNOPSIS
      mcxmap -imx fname (input) [-o fname (output)] [-make-map (output map file name)] [-make-mapc (output map file name)] [-make-mapr (output map
      file name)] [-cmul a (coefficient)] [-cshift b (translate)] [-rmul c (coefficient)] [-rshift d (translate)] [-mul e (coefficient)] [-shift f
      (translate)]  [-map  fname  (row/col  map file)] [-rmap fname (row map file)] [-cmap fname (column map file)] [-mapi fname (row/col map file
      (use inverse))] [-rmapi fname (row map file (use inverse))] [-cmapi fname (column map file (use inverse))] [-tab fname (read (and  map)  tab
      file)]

  DESCRIPTION
      This utility relabels graphs or matrices. Its main use is in applying a map file to a given matrix or graph. A map file contains a so called
      map matrix in mcl format that has some special properties (given further below). The functionality of mcxmap can also be provided by mcx, as
      a  mapped  matrix  (i.e.	the  result  of  applying a map matrix to another matrix) is simply the usual matrix product of a matrix and a map
      matrix. However, mcx will construct a new matrix and leave the original matrix to be mapped alone. When dealing with huge matrices,  consid-
      erable  gains  in  efficiency  memory-wise  and  time-wise  can be achieved by doing the mapping in-place.  This is what mcxmap does. In the
      future, its functionality may be embedded in mcx with new mcx operators.

      The special properties of a map matrix are

      o The column domain and row domain are of the same cardinality.
      o Each column has exactly one entry.
      o Each row domain index occurs in exactly one column.

      These properties imply that the matrix can be used as a map from the column domain onto the row domain.  An example map matrix is  found	in
      the EXAMPLES Section.

  OPTIONS
      -o fname (output file)
	Output file.

      -imx fname (input file)
	Input file.

      -map fname (row/col map file))
      -rmap fname (row map file)
      -cmap fname (column map file)
      -mapi fname (row/col map file (use inverse))
      -rmapi fname (row map fil (use inverse))
      -cmapi fname (column map fil (use inverse))
	Different ways to specify map files.

      -make-map (output map file name)
      -make-mapc (output map file name)
      -make-mapr (output map file name)
	Generate a map that maps the specified domain onto the appropriate canonical domain and write the map matrix to file.

      -cmul a (coefficient)
      -cshift b (translate)
	These  options	have  affect if neither a column map file nor column canonification is specified. If any of the first two options is used,
	column indices i are mapped to a*i+b.

      -rmul c (coefficient)
      -rshift d (translate)
	These options have affect if neither a row map file nor row canonification is specified.  If  any  of  the  first  two	options  is  used,
	indices i are mapped to c*i+d.

      -mul e (coefficient)
      -shift f (translate)
	If  a  map  file  is  specified for a given domain, neither a map file nor canonification is specified. If any of the first two options is
	used, the indices i will be mapped to e*i+f.

      -tab fname (read (and map) tab file)
	This option requires the -map option. mcxmap will output the mapped tab definition.

  EXAMPLES
      The matrix below has two canonical domains which are identical.  It denotes a map of the canonical domain onto itself, in which  node  0	is
      relabeled to 8, node 1 is relabeled to 5, et cetera.

      (mclheader
      mcltype matrix
      dimensions 12x12
      )
      (mclmatrix
      begin
      0  8  $
      1  5  $
      2  3  $
      3  2  $
      4  4  $
      5  6  $
      6  7  $
      7  9  $
      8  1  $
      9  10 $
      10 11 $
      11 0  $
      )

  AUTHOR
      Stijn van Dongen.

  SEE ALSO
      mcxio(5), mcx(1), mcxsubs(1), and mclfamily(7) for an overview of all the documentation and the utilities in the mcl family.

  mcxmap 12-068 						      8 Mar 2012							   mcxmap(1)
All times are GMT -4. The time now is 05:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy