![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Microsoft Security Advisory (953818): Blended Threat from Combined Attack Using Apple | iBot | Security Advisories (RSS) - Microsoft | 0 | 06-02-2008 08:30 PM |
| combined stdout & stderr | slavam | UNIX for Advanced & Expert Users | 11 | 10-12-2007 04:06 PM |
| grep command with combined variables in Ksh | cin2000 | Shell Programming and Scripting | 4 | 02-22-2006 10:57 AM |
| help on find with chmod.. urgent help needed | sdlayeeq | UNIX for Advanced & Expert Users | 4 | 03-29-2005 12:05 AM |
| chmod 777 on all directories below...how do I do that using the "find" command? | Neko | UNIX for Dummies Questions & Answers | 7 | 07-12-2001 10:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
FIND/CHMOD combined
I am trying to change permission for all subdirectories and files inside folder1 so this is what i came with after many seraches on the internet. man find and man chmod mirc and few articles.
Code:
find .public_html/folder1 -print0 | xargs -0 chmod 777 it is FTP Server btw, if it means something at all ![]() Thanks <edit> Ah i nearly forgot to say that i also tried with recursive method of the CHMOD command: Code:
chmod -R 777 public_html/folder1 Thanks ones again ![]() Last edited by smoother; 09-17-2007 at 03:18 AM.. Reason: more info about the problem |
|
||||
|
Nope ! the same result. Nothing happens
![]() Maybe i should mention that i am executing this command from C# code. Actually i am trying to send this command from C# FTP Client and please notice that it works flawless if i target only single file or directory. I just cannot make it to works for all files and dirs inside the selected directory. in a recursive manner. For example this is the code that change permissions for index.html file: Code:
TcpClient tcpClient = new TcpClient();
tcpClient.Connect(this.txtServerAddress.Text, Convert.ToInt32(this.txtPortNumber.Text));
NetworkStream netStream = tcpClient.GetStream();
System.IO.StreamReader strReader = new System.IO.StreamReader(netStream);
byte[] WriteBuffer = new byte[1024];
//passing ASCII characters
ASCIIEncoding enc = new System.Text.ASCIIEncoding();
// Pass the username to the server
WriteBuffer = enc.GetBytes("USER " + "username" + "\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
// Read the server response line from the stream reader
MessageBox.Show(strReader.ReadLine());
// Pass the password to the server
WriteBuffer = enc.GetBytes("PASS " + "password" + "\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
// Read the server response line from the stream reader
MessageBox.Show(strReader.ReadLine());
//CHANGE PERM. OF INDEX.HTML
WriteBuffer = enc.GetBytes("CHMOD 775 " + "public_html/index.html" + "\r\n");
netStream.Write(WriteBuffer, 0, WriteBuffer.Length);
// Read the server response line from the stream reader
MessageBox.Show(strReader.ReadLine());
tcpClient.Close();
Thanks for any further help ![]() |
![]() |
| Bookmarks |
| Tags |
| chmod, find, finding files, xargs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|