Skip to content
Prev 163867 / 398506 Next

setwd and list.files / linux

Hi Lars,

I am having trouble replicating this problem, using the default
file/folder permissions on my Fedora 10 system.

When creating a new folder, I get:

mkdir Test

drwxrwxr-x  2 marcs marcs   4096 2008-12-05 08:17 Test


When creating a new file, I get:

touch Test.txt

-rw-rw-r-- 1 marcs marcs 0 2008-12-05 08:17 Test.txt


Even when modifying the file permissions to be similar to yours:

chmod 644 Test.txt

-rw-r--r-- 1 marcs marcs 0 2008-12-05 08:17 Test.txt


I can still read the file from a different folder.  It is likely that
your 'umask', which defines the default file/folder permissions on your
system is different than mine. For me, as a regular user, it is 002.
This value is usually defined in /etc/bashrc:

$ grep umask /etc/bashrc
	umask 002
	umask 022

The first value is for a regular user, the second for 'root'.

It is likely that your umask is 022 based upon the file permissions that
you list, as that would result in a default permission of 644. This
might mean that the default umask on RHEL is different than on Fedora,
or perhaps your default umask has been changed in ~/.bashrc.

I suspect that you might have a folder permission issue, rather than a
file permission issue and I think that would be consistent with the
behavior that you are observing.

I would check the permissions on each folder in the path that you are
trying to access to see if something is amiss there. Perhaps try using
setwd() on each folder in the datapath tree, starting at 'the top',
adding a new lower level folder each time, until it fails. That might
provide some guidance.

HTH,

Marc
on 12/05/2008 02:46 AM Lars Beckmann wrote: