From: keithv on
Is the mode value from file stat meaningful on Windows.
Under tcl 8.5, it always seems to return 0644
even if you have permission write to the file.

(This problem came up when I was trying to figure
out why tcllib's ftpd package wouldn't let me delete
a file.)

Thanks,
Keith
From: Arjen Markus on
On 20 jan, 00:47, keithv <kvet...(a)gmail.com> wrote:
> Is the mode value from file stat meaningful on Windows.
> Under tcl 8.5, it always seems to return 0644
> even if you have permission write to the file.
>
> (This problem came up when I was trying to figure
> out why tcllib's ftpd package wouldn't let me delete
> a file.)
>
> Thanks,
> Keith

Under older versions of Windows there was no concept of permissions
for user,
group and other. With at least Windows XP and beyond there is
something
similar but I am not sure if the mapping is one to one (you can define
file permissions for different groups, it seems). It probably
requires
extra, Windows-specific, functions to retrieve the information.

Regards,

Arjen
From: APN on
On Jan 20, 4:47 am, keithv <kvet...(a)gmail.com> wrote:
> Is the mode value from file stat meaningful on Windows.
> Under tcl 8.5, it always seems to return 0644
> even if you have permission write to the file.
>
> (This problem came up when I was trying to figure
> out why tcllib's ftpd package wouldn't let me delete
> a file.)
>
> Thanks,
> Keith

This is a itsy-bitsy bug caused by hex-octal typos. Also verified for
8.6b1.

I've entered the bug and patch as bug 2935503 in sourceforge.

/Ashok
From: keithv on
On Jan 20, 4:28 am, APN <palm...(a)yahoo.com> wrote:
> On Jan 20, 4:47 am, keithv <kvet...(a)gmail.com> wrote:
>
> > Is the mode value from file stat meaningful on Windows.
> > Under tcl 8.5, it always seems to return 0644
> > even if you have permission write to the file.
>
> > (This problem came up when I was trying to figure
> > out why tcllib's ftpd package wouldn't let me delete
> > a file.)
>
> > Thanks,
> > Keith
>
> This is a itsy-bitsy bug caused by hex-octal typos. Also verified for
> 8.6b1.
>
> I've entered the bug and patch as bug  2935503 in sourceforge.

From your patch it looks like a script level fix would be
file stat $fname stat
set stat(mode) [expr {($stat(mode) & ~0077) | (($stat(mode) & 0700)
>> 3) | (($stat(mode) & 0700) >> 6)}]

Keith
From: APN on
On Jan 20, 8:23 pm, keithv <kvet...(a)gmail.com> wrote:
> On Jan 20, 4:28 am, APN <palm...(a)yahoo.com> wrote:
>
>
>
> > On Jan 20, 4:47 am, keithv <kvet...(a)gmail.com> wrote:
>
> > > Is the mode value from file stat meaningful on Windows.
> > > Under tcl 8.5, it always seems to return 0644
> > > even if you have permission write to the file.
>
> > > (This problem came up when I was trying to figure
> > > out why tcllib's ftpd package wouldn't let me delete
> > > a file.)
>
> > > Thanks,
> > > Keith
>
> > This is a itsy-bitsy bug caused by hex-octal typos. Also verified for
> > 8.6b1.
>
> > I've entered the bug and patch as bug  2935503 in sourceforge.
>
> From your patch it looks like a script level fix would be
>   file stat $fname stat
>   set stat(mode) [expr {($stat(mode) & ~0077) | (($stat(mode) & 0700)
>
> >> 3) | (($stat(mode) & 0700) >> 6)}]
>
> Keith

Seems right.
 |  Next  |  Last
Pages: 1 2
Prev: weird behavior of lsort
Next: for loop variable scope