Alpha Video Training
Results 1 to 8 of 8

Thread: Files beginning with $

  1. #1
    Member Gil Smith's Avatar
    Real Name
    Gil Smith
    Join Date
    May 2001
    Location
    Billingham, England
    Posts
    217

    Default Files beginning with $

    I have been using Alpha 5 for two years now and I have dozens of files beginning with the $ sign in the Alpha directory. I assume these are temporary files which I can delete. Is this the case? Also why does Alpha create them?

  2. #2
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Files beginning with $

    These are temporary index files which alpha makes while building a query list. You may safely delete. Look in view settings for the checkbox that tells Alpha to delete temp files on exit.

    Bill

  3. #3
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Files beginning with $

    Bil, as always, is correct. Sometimes Alpha doesn't delete the files, even though you have made the suggested settings. I'm including a script (author undientified, supplied by another board member, and though I've searched, I can't identify) that will delete .mpx files. It can easily be modified to delete any other files you like. Best attached to the onexit event of your startup form.

    ''XBasic
    on error goto no_mpx_files
    files = filefind.first(:A5.Get_Shared_Path() + chr(92) + "*.mpx")
    WHILE .not. files.eof()
    table_name = files.name() 'cleanup alpha
    file.remove(table_name)
    files.next()
    end while
    END

    no_mpx_files:
    on error goto 0
    END

  4. #4
    Geoffrey Hollander
    Guest

    Default RE: Files beginning with $

    Stan,

    I've been wondering about that myself. Thanks for the answer and the code.

    Regards,

    Geoff Hollander

  5. #5
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Files beginning with $

    Like I stated earlier

    (author unidentified, supplied by another board member, and though I've searched, I can't identify)


    It's a wonderful script, but not mine. Will the author please take a bow.

  6. #6
    "Certified" Alphaholic
    Real Name
    William Hanigsberg
    Join Date
    Apr 2000
    Location
    Toronto, ON
    Posts
    4,018

    Default RE: Files beginning with $

    I believe it is from Finian Lennon but I may be mistaken.

    Bill

  7. #7
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default RE: Files beginning with $

    I didn't think he was that smart. Go figure.

  8. #8
    VAR csda1's Avatar
    Real Name
    Ira J Perlow
    Join Date
    Apr 2000
    Location
    Boston, Massachusetts, USA
    Posts
    3,530

    Default RE: Files beginning with $

    Stan,

    The code you listed (I know you don't take claim for it!) will not work correctly for 2 reasons. First and foremost is the fact that mpx files are stored in the Private Path, not the shared path. On many systems this is the same, but not always. Second, if there is an MPX file currently in use, an error will occur and the code will stop immediately.

    Listed below (and attached as a ZIP file) is code that works a bit better.

    Regards,

    Ira J. Perlow
    Computer Systems Design & Associates
    csda@mediaone.net


    function DeleteTempFiles as N()
    ' Created by Computer Systems Design & Associates
    ' Copyright 2001 Computer Systems Design & Associates, All Rights Reserved
    ' Last Update: December 10, 2000

    ' Purpose: To delete all temporary files ending in "mpx" in the private directory.
    ' If file is not accessible or is being used, it will not be deleted.

    ' Input: None

    ' Output:# of files deleted

    ' Errors:None

    ' Typical Usage:
    ' DeleteTempFiles()

    ' Examples:
    ' DeleteTempFiles()

    ' Notes:

    ' Set inital return value
    DeleteTempFiles=0

    ' Set filespec of temporary files to delete
    Filespec="*.mpx"

    ' Save the original directory
    orgdir=dir_get()

    ' Set private path as current directory
    newdir=dir_put(:A5.Get_Private_Path())

    ' Get first file in directory that meets file spec
    filelist=filefind.first(filespec)

    ' Set Delete count initially to 0
    delcnt=0

    ' Set Unable to Delete count initially to 0. This count is only used for debug
    nodel=0

    ON ERROR GOTO error_handler
    WHILE .not.filelist.eof()
    ' Set error flag to 0
    errflag=0

    ' Try to remove file
    File.Remove(filelist.name())
    ' trace.writeln("File to be removed="+chr(34)+dir_get()+chr(92)+filelist.name()+chr(34))

    ' Set counts
    IF errflag=0
    delcnt=delcnt+1
    ELSE
    nodel=nodel+1
    END IF

    ' Get pointer to next file
    filelist.next()
    END WHILE

    ON ERROR GOTO 0

    ' Restore Original directory
    dir_put(orgdir)

    ' Return count of files deleted
    DeleteTempFiles=delcnt

    'trace.writeln("Deleted Count="+LTRIM(STR(delcnt))+" Not Deleted Count="+LTRIM(STR(nodel)))

    END

    ' Error Handler sets errflag to 1 if error
    error_handler:
    'trace.writeln("Error code="+ltrim(str(error_code_get()))+" Error text="+error_text_get())
    errflag=1
    RESUME NEXT

    END

    end function


Similar Threads

  1. New Help Files
    By Edward Larrabee in forum Announcements
    Replies: 1
    Last Post: 01-03-2005, 01:45 AM
  2. Beginning a relational database
    By lbrady in forum Alpha Five Version 5
    Replies: 1
    Last Post: 04-04-2003, 04:49 PM
  3. PDF Files
    By Michael Humby in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-03-2002, 10:54 AM
  4. Appending files with files(Non A5)
    By Nathan White in forum Alpha Five Version 4
    Replies: 6
    Last Post: 02-15-2001, 07:51 AM
  5. Beginning Database
    By Chris Stevenson in forum Alpha Five Versions 2 and 3
    Replies: 1
    Last Post: 09-20-2000, 01:15 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •