Current Page:
NeXtMidas Training
Working with Files
Lab 2
Solution
|
|
- Lab 2 (solution):
- Here is what you should have done:
- Dump the lines in the source code for the
STATUS command
($NMROOT/nxm/sys/intr/Status.java ) using the package syntax.
nM> stat nxm.sys.intr.Status.java /d=-1
- Form the path for
apenny.prm in AREA=DAT ,
OPT=SYS in a platform independent way. Then use the
if command to check for its existence from the shell.
nM> fname filename NAME=apenny EXT=prm OPT=SYS AREA=DAT
nM> if filename FEXISTS
or
nM> if nxm.sys.dat.apenny.prm FEXISTS
or
nM> file name fullname (^env.nmroot,nxm,sys,dat) apenny prm
nM> if fullname FEXISTS
- Can you list the files in
original: http://nextmidas.com/nm/nxm/sys/dat/ (currently unavailable)
alternate: file:///opt/midas/nxmlatest/nxm/sys/dat/
(where /opt/midas/nxmlatest is a softlink to your local nxm installation)
Why or why not?
Yes. The nextmidas.com web server is configured
to provide a directory listing, but this may not
be the case with all web servers.
- Can you
status the file
original: http://nextmidas.com/nm/nxm/sys/dat/apenny.prm (currently unavailable)
alternate: file:///opt/midas/nxmlatest/nxm/sys/dat/apenny.prm
(where /opt/midas/nxmlatest is a softlink to your local nxm installation)
Why or why not?
Yes. The nextmidas.com web server, like most web
servers, is configured to allow access to this file.
- Use the
NOOP command to copy the first half of the elements from
original: http://nextmidas.com/nm/nxm/sys/dat/apenny.prm (currently unavailable)
alternate: file:///opt/midas/nxmlatest/nxm/sys/dat/apenny.prm
(where /opt/midas/nxmlatest is a softlink to your local nxm installation) to a file
halfpenny.prm in your WRITE aux.
original: nM> noop http://nextmidas.com/nm/nxm/sys/dat/apenny.prm(0:64) halfpenny.prm
alternative: nM> noop /opt/midas/nxmlatest/nm/nxm/sys/dat/apenny.prm(0:64) halfpenny.prm
(Note that the 64 is exclusive and it will copy elements 0 through
63 to the new file.)
|
|
|