Date: Thu, 18 May 2006 00:00:44 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 704 ************************************************** Wednesday 17 May 2006 Number 704 ************************************************** Subjects for today 1 utimes chown and xattr : Dave Bamford 2 AWK script : John Poltorak 3 Re: AWK script : Steven Levine" 4 Re: AWK script : John Poltorak 5 Re: AWK script : Steve Drewell **= Email 1 ==========================** Date: Tue, 16 May 2006 15:09:50 +0100 From: Dave Bamford Subject: utimes chown and xattr Nearly finished the porting of this BoxBackup program but I have a few minor issues to resolve. I cannot retrieve the file attributes from the backup store ::utimes(Filename, times) returns an error which gives errno 13 [EACCES] Search permission is denied by a component of the path prefix; or the /times/ argument is a null pointer and the effective user ID of the process does not match the owner of the file and write access is denied. The times structure has good data (I think) and Filename returns just the filename (no path) this statement printf("BCFA.cpp:634\nfilename=%s\n0=%d\n1=%d\n",Filename,times[0],times[1]); gives filename=Tame.ico 0=1047503576 1=0 Although I tried to set times[0] and times[1] to the same, but I realise its a structure of seconds in unixtime and milliseconds but I am not sure how to interrogate it correctly. The other thing that gives me an erro is this ::chmod(Filename, mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_ISUID | S_ISGID | S_ISVTX)) I guess it is probably the same problem Finally is there any support for extended attributes, unix has some xattr stuff but I can't find anything in OS/2 emx libraries BTW I am using gcc 3.3.5 and libc601 (latest) Regards Dave Bamford. **= Email 2 ==========================** Date: Wed, 17 May 2006 00:08:51 +0100 From: John Poltorak Subject: AWK script The following AWK script has been suggested as a means of performing a task I want achieve awk -F';' '{for(i=2;i$1}' How would I run it under OS/2? -- John **= Email 3 ==========================** Date: Tue, 16 May 2006 23:56:30 -0700 From: "Steven Levine" Subject: Re: AWK script In <20060517000851.M46 at warpix.org>, on 05/17/06 at 12:08 AM, John Poltorak said: >awk -F';' '{for(i=2;i$1}' >How would I run it under OS/2? Depending on the shell you are running, exactly as you have shown it or with some tweaks to handle any quoting issues. Bash etc. should run the command line unsullied. Cmd.exe will need the quotes adjusted. You do need to supply an input file via stdin. Steven -- ---------------------------------------------------------------------- "Steven Levine" MR2/ICE 2.67 #10183 Warp/eCS/DIY/14.103a_W4 www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) ---------------------------------------------------------------------- **= Email 4 ==========================** Date: Wed, 17 May 2006 08:23:13 +0100 From: John Poltorak Subject: Re: AWK script On Tue, May 16, 2006 at 11:56:30PM -0700, Steven Levine wrote: > In <20060517000851.M46 at warpix.org>, on 05/17/06 > at 12:08 AM, John Poltorak said: > > >awk -F';' '{for(i=2;i$1}' > > >How would I run it under OS/2? > > Depending on the shell you are running, exactly as you have shown it or > with some tweaks to handle any quoting issues. Bash etc. should run the > command line unsullied. Cmd.exe will need the quotes adjusted. You do > need to supply an input file via stdin. I was thinking of cmd.exe and don't know how to incorporate quotes when quotes are actually included in the script itself. > Steven > > -- > ---------------------------------------------------------------------- > "Steven Levine" MR2/ICE 2.67 #10183 Warp/eCS/DIY/14.103a_W4 > www.scoug.com irc.fyrelizard.com #scoug (Wed 7pm PST) > ---------------------------------------------------------------------- > -- John **= Email 5 ==========================** Date: Wed, 17 May 2006 09:43:58 +0100 From: Steve Drewell Subject: Re: AWK script John Poltorak wrote: > On Tue, May 16, 2006 at 11:56:30PM -0700, Steven Levine wrote: > >>In <20060517000851.M46 at warpix.org>, on 05/17/06 >> at 12:08 AM, John Poltorak said: >> >> >>>awk -F';' '{for(i=2;i$1}' >> >>>How would I run it under OS/2? >> >>Depending on the shell you are running, exactly as you have shown it or >>with some tweaks to handle any quoting issues. Bash etc. should run the >>command line unsullied. Cmd.exe will need the quotes adjusted. You do >>need to supply an input file via stdin. > > > I was thinking of cmd.exe and don't know how to incorporate quotes when > quotes are actually included in the script itself. How about putting this in a text file: {for(i=2;i$1} and executing it via the command: awk -F';' -f name_of_text_file Steve -- Geophysicist - Depth Imaging WesternGeco, Schlumberger House, Buckingham Gate, Gatwick Airport, UK Tel: +44 (0) 1293 556383 Fax: +44 (0) 1293 556066