Previous Next        Current Page: NeXtMidas Training / Working with Files / Basic File Commands / FNAME - Forming file names
Start Here   
Background   
Common Midas Concepts   
Getting Started - Part 1   
Getting Started - Part 2   
Working with Files   
   - File Basics   
   + The AUX List   
   - Basic File Commands   
      - FILES - Finding files   
      - FNAME - Forming file names   
      - STATUS - Listing file headers   
      - DATALIST - Listing file data   
      - HEADERMOD - Modifying file headers   
      - FILE - Modifying file data   
   + Lab 1   
   + File Names   
   + File Types   
   + Lab 2   
   + Listing Files   
   + Lab 3   
   + Plotting Files   
   + Lab 4   
Option Trees   
Macros - Part 1 (Basics)   
Macros - Part 2 (Graphics)   
NetBeans - Part 1 (Setup)   
NetBeans - Part 2 (GUIs)   
NetBeans - Part 3 (Profiler)   
Eclipse - Part 1 (Setup)   
Eclipse - Part 2 (GUIs)   
Primitives   
Applets & WebStart   
Maps & Imagery   
X-Midas Interoperability   
RMIF & Remoting   
Installing NeXtMidas   
Support & Maintenance   
File Handlers   


  • The FNAME Command:
    • The FNAME command is used to form or parse file names.
    • The component parts AREA=, NAME=, EXT=, and OPT= are put together to form a full file name. For example:
      nM> fname label=fullname area=dat name=airports ext=csv opt=sys
      nM> res fullname
      41S: FULLNAME        = /home/burdell/nxm230/nxm/sys/dat/airports.csv
    • It is also possible to go in reverse and extract AREA= (in this case area gets the directory path), NAME=, EXT=, and OPT= from a full file name. For example:
      nM> fname label=fullname area=mypath name=myname ext=myext opt=myopt /parse
      nM> res my*
       3S: MYEXT           = csv
       8S: MYNAME          = airports
      41S: MYPATH          = /home/burdell/nxm230/nxm/sys/dat/
    • Why use this? -- To improve portability between Linux and Windows by not including path delimiters!
    • The FILE NAME function may also be used to form platform-agnostic file names.
X-Midas Users Take Note:
Like most commands in NeXtMidas, the FNAME command can be used with both Midas files and non-Midas files alike.