Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#21 RFE4IBM: new file system related external functions

Windows
closed
nobody
5
2012-08-14
2005-01-20
No

(id #10) In most of my REXX programs under Windows 95 I
frequently use file manipulation commands like RENAME
and COPY, and I feel that they take very long to
execute. It is way faster to read and write a file
using the REXX I/O functions than it is to use the
Windows COPY command. So, since there
is a SysFileDelete, would it be possible to add a set
of similar functions for the other common commands, for
example:

SysFileRename
SysFileCopy
SysFileMove
SysFileDelTree
SysFileExist alternative to
Stream(...,'c','query exists')
SysFileValidate similar to the CMS VALIDATE command

Error checking could be kept to a minimum. It's the
programmer's responsibility to provide valid arguments,
and all functions required to do the necessary
pre-processing are already there (DIRECTORY, FILESPEC,
SYSFILETREE, etc). Talking about FILESPEC, it would be
nice to have two additional options to return only the
name and extension part of the file name. No big deal,
but it's a quite common task to parse out the
extension, so it could save a few lines of code.

Discussion

  • mdlueck
    mdlueck
    2005-02-07

    Logged In: YES
    user_id=1014305

    Also consider SysDirExists - This covers my need for ISfile
    and ISdir which return logical.

    SysFileCopy should properly handle 0 length files, file
    attributes on the host OS, etc...

    It would be nice to also have SysFileCRC32 and SysFileMD5.
    Possibly these could accept either a filename, or a string /
    mutablebuffer object which has the contents already in it.

    Platform specific it would be nice to access the string data
    stored in executable files. At least Win32 has these, I
    would assume other platforms do as well.

    Is CMS VALIDATE something to check that the filespec is
    valid? Does it simplfy things like /../ and /./ which could
    appear in Win32/*nix filespecs? I use the stream qualify
    method for that, and will submit ideas for enhancing stream
    qualify and filespec in separate tickets.

     
  • mdlueck
    mdlueck
    2005-02-26

    Logged In: YES
    user_id=1014305

    Suggested Rexx code to extend SysMkDir to make entire
    dirtrees in a single call... I wrap the NT 'md' command
    since it can do this, else this code for Win9x, *nix, and OS/2.

    / All other OS's /
    otherwise do
    ArcChar=self~GetArcChar()
    / Set that we think the dir currently exists /
    DIRexists=1

    CHKdir=''
    do until FINDfilename=''
    parse var FINDfilename THISdir (ArcChar) FINDfilename
    CHKdir=CHKdir || THISdir || ArcChar

      /* See if this DIR exists / only check if we still
    

    think DIRS should exist /
    if DIRexists then do
    /
    If we found a dir that does not exist, flag that
    and we will not check again /
    if \ self~ISdir(CHKdir) then DIRexists=0
    end /
    if */

      /* If the dir does not exist, try to make it */
      if \ DIRexists then do
         rc=SysMkDir(CHKdir)
         if rc\=0 then do
            LDSLogging~Logger('LDSFileSystem~MAKEdir ERROR!
    

    -> Can not make dir='CHKdir' RC='rc)
    return 0
    end / if /
    end / if /
    end / do until /
    end / otherwise /

     
  • David Ashley
    David Ashley
    2007-05-02

    Logged In: YES
    user_id=931756
    Originator: NO

    With the exception of SysFileRename and SysFileMove most of this RFE has been implemented. So I am going to close this RFE.

     


Anonymous


Cancel   Add attachments