help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: May I want Octave to write files as '-rw-rw-rw-'?


From: Jun Ohta
Subject: Re: May I want Octave to write files as '-rw-rw-rw-'?
Date: Thu, 29 Sep 2005 01:11:57 +0900

>The -x- bit is used to make an file executable (the fact that there are 
>three -x-'s is for the user/group/all)
>So unless you are using octave for some extremely exotic work (In which 
>case I would recommend using something else) I cannot see the reason why 
>you would want to execute your data-files from linux directly.
>If you really want to give all permissions to the file you could do 
>system('chmod 777 <filename>');
>where <filename> is the filename you want to change. But please think 
>again for using an other system to create executables.

Thank you for your comment. I think your comment is quite reasonable. 
On the other hand, honestly, in my work, I sometimes needed to make 
Octave or Matlab to write Win98's BAT files. It was because those BAT 
files were written using numbers in variables or elements in matrices 
used on Octave or Matlab. This method was very useful for my purpose. 
I wish you and Octave developers to understand such a use of Octave 
as a potential of Octave. I think your comment about 'chmod 777 <
filename>' will be useful for me in future. I will think again about 
my above approach.
  
I checked the behaviors and effects of the following 4 'umask's.
   [1] 'umask' on Octave (cygwin, WinXP)
   [2] 'umask' on Octave (cygwin, Win98)
   [3] 'umask' on cygwin (WinXP)
   [4] 'umask' on cygwin (Win98)
[1] seemed different from [2], and [3] seemed different from [4].
On the other hand, [1] seemed the same as [3], and [2] seemed the 
same as [4].
Now I understand the behavior and effect of umask on Octave is 
dependent on WinXP or Win98. 

Jun Ohta


Gerald Ebberink <address@hidden> wrote:
(2005/09/28 17:43)

>Jun Ohta wrote:
>>Thank you, John,  for your prompt response. My apology for my late 
>>response.
>>It's because I tested several times. Now I have a question.
>>
>>  
>>>| On cygwin, when I have Octave write a file using 'fopen', 'fprintf, 
>>>| and 'fclose', I usually get the written file as '-rw-r--r--'. 
>>>| Is there any way to setup Octave to write files as '-rw-rw-rw-' or '-
>>>| rwxrwxrwx'?
>>>
>>>Try umask (0) before opening the file.
>>>    
>>
>>I tried umask (0) before opening the file. when I have Octave write a 
>>file using 'fopen', 'fprintf, and 'fclose', I can usually get the 
>>written file as '-rw-rw-rw-', not as '-rw-r--r--'. 
>>
>>This is different from the behavior I expected. I expected that I 
>>would get the written file as '-rwxrwxrwx', not as '-rw-rw-rw-'. I 
>>wonder if the behavior I observed is normal on cygwin or linux? I 
>>would appreciate any comments.
>>
>>  
>The -x- bit is used to make an file executable (the fact that there are 
>three -x-'s is for the user/group/all)
>So unless you are using octave for some extremely exotic work (In which 
>case I would recommend using something else) I cannot see the reason why 
>you would want to execute your data-files from linux directly.
>If you really want to give all permissions to the file you could do 
>system('chmod 777 <filename>');
>where <filename> is the filename you want to change. But please think 
>again for using an other system to create executables.
>
>-- 
>Ing. ing. Gerald Ebberink
>Research Technician
>
>Kernfysisch Versneller Instituut
>Rijksuniversiteit Groningen
>Zernikelaan 25
>9747 AA Groningen
>The Netherlands
>tel: +31 50 363 3518
>lab: +31 50 363 3588
>mob: +31 61 644 4242
>fax: +31 50 363 4003




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]