Thanks to everyone for the input!
Well, I finally got the "rm" command to remove the file. Why the "fix"
matters to the shell, I don't know.
I had been performing the following steps (from a program running from a
MANAGER.SYS session):
+ BUILD the bytestream file specifying the full path name
+ FOPEN the file
+ FWRITE to the file (multiple times)
+ FCLOSE the file
+ chown the file to SAMBA.SHARE:SHARE
+ chmod the file to 744
Then, after other processing takes place,
+ rm the file
This final step, the "rm", didn't work, but the MPE/iX command PURGE did work.
Well, I've found more odd behavior. Sometimes the "chmod" works, and
sometimes it doesn't. It seems to always work when issued interactively,
but when issued programmatically, it fails the majority of the time.
So, I changed the order of the "chown" and "chmod" commands (so that
"chmod" executes first, then the "chown"), and guess what! Suddenly the
"rm" command works!
There are certainly interesting quirks in POSIX-land, and I guess I can see
how executing the "chmod" first (could make a difference.
Thanks to all who offered suggestions! I tried them out and different
points in my experiments and now I wish I had taken better notes, as there
were some really strange errors along the way.
John
At 2003-06-25 01:26 PM, John Korb wrote:
>Ah, the joys of POSIX-land.
>
>I'm trying to purge a file which was created by MANAGER.SYS in another
>account. After MANAGER.SYS BUILDs the file, writes data to the file,
>"chown" the file, and "chmod" the file, the file is available for various
>applications to read. Or at least that is the idea. I've run one test,
>and I've found a snag.
>
>The snag is that I need to "rm" the file. Unfortunately, "rm" won't
>work. The really odd part is that "PURGE" will work (see below). Anyone
>run into this quirk before? Anyone know WHY this happens?
>
>John
>
>(reminder: The user executing the commands below is MANAGER.SYS)
>
>shell/iX> pwd
>/SHARE/PUB/data/dbinput/data
>
>shell/iX> ls -l
>total 4200
>-rw------- 1 SAMBA.SHARE SHARE 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>shell/iX> rm 2003-06-25_data_good.csv
>rm: cannot unlink entry "2003-06-25_data_good.csv": No such file or directory
>
>shell/iX> rm 2003-06-25*
>rm: cannot unlink entry "2003-06-25_data_good.csv": No such file or directory
>
>shell/iX> ls -l
>total
>4200
>
>-rw------- 1 SAMBA.SHARE SHARE 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>
>shell/iX> chmod 774 2003-06-25_data_good.csv
>shell/iX> ls -l
>total 4200
>-rwxrwxr-- 1 SAMBA.SHARE SHARE 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>
>shell/iX> rm 2003-06-25_data_good.csv
>rm: cannot unlink entry "2003-06-25_data_good.csv": No such file or directory
>
>shell/iX> rm *
>rm: cannot unlink entry "2003-06-25_data_good.csv": No such file or directory
>
>shell/iX> ls -l
>total 4200
>-rwxrwxr-- 1 SAMBA.SHARE SHARE 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>
>shell/iX> chown MANAGER.SYS:SYS 2003-06-25_data_good.csv
>shell/iX> ls -l
>total 4200
>-rwxrwxr-- 1 MANAGER.SYS SYS 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>
>shell/iX> chmod 777 2003-06-25_data_good.csv
>shell/iX> ls -l
>total 4200
>-rwxrwxrwx 1 MANAGER.SYS SYS 2150364 Jun 25 13:00
>2003-06-25_data_good.csv
>
>shell/iX> rm 2003-06-25_data_good.csv
>rm: cannot unlink entry "2003-06-25_data_good.csv": No such file or directory
>
>shell/iX> exit
>
>:
>:purge /SHARE/PUB/data/dbinput/data/2003-06-25_data_good.csv
>:
>:
>:listfile /SHARE/PUB/data/dbinput/data/@,2
>No match found for the pathname. (CIWARN 9043)
>:
>:sh
>########################################################################
>
> MPE/iX Shell and Utilities (A.50.02)
> COPYRIGHT (c) Hewlett-Packard Company 1992, All Rights Reserved.
>
>########################################################################
>
>
>you have mail in /usr/mail/MANAGER.SYS.
>shell/iX> cd /SHARE/PUB/data/dbinput/data
>
>shell/iX> ls -l
>total 0
>
>shell/iX> pwd
>/SHARE/PUB/data/dbinput/data
>
>shell/iX> exit
>
>:
>
>* To join/leave the list, search archives, change list settings, *
>* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|