Forum Moderators: coopster

Message Too Old, No Replies

Ssh2

         

optik

7:09 pm on Dec 16, 2009 (gmt 0)

10+ Year Member



I'm using ssh2 a PHP extension to create a new folder on my server, however if I try and set the permissions of that folder above the default of 0755 it creates the folder with that default setting.

It seems like there is some setting preventing me creating a folder with higher permissions e.g 0777.

penders

7:26 pm on Dec 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Does the current umask effect these functions, as it does with mkdir() [uk2.php.net] ?

optik

10:41 am on Dec 18, 2009 (gmt 0)

10+ Year Member



I tried unmask and it didn't seem to work over ssh2

optik

11:06 am on Dec 18, 2009 (gmt 0)

10+ Year Member



The original issue of not being able to delete folders remotely seems to of gone away now

optik

10:56 pm on Jan 3, 2010 (gmt 0)

10+ Year Member



This is not resolved I thought it was fixed but I had used umask on the folder in question normally so the folder deleted.

I still can't delete folders using SSH2.

rocknbil

12:10 am on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are the directories empty?

optik

1:10 pm on Jan 5, 2010 (gmt 0)

10+ Year Member



That seems to be it, once the folder it is empty it will delete, thanks a lot.

rocknbil

8:47 pm on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The reason I asked is, if you are doing a command line rmdir (or via exec command in PHP) you can use the -R flag (recursive) which will delete anything in the directory.

This is a very, very, dangerous command, be sure it's pointed at the right directories. You can't do too many checks before executing it to be safe.

I'm sure PHP has a flag available for this, just don't have it handy.

optik

9:43 pm on Jan 5, 2010 (gmt 0)

10+ Year Member



I didn't even realise rmdir needed an empty folder, I should of noticed this by now :)