Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Filefind.get - archive bit issue.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Filefind.get - archive bit issue.

    I've been driven crazy a few times ever since A5v5 when using the FileFind.Get() function. Sometimes it just doesn't want to show me all the files that I know are there. I've known for a long time that the issue had to do with the "archive bit" in Windows but was using the function incorrectly and not able to get the complete list of all files - both those with and those without the archive bit turned on.

    I finally figured it out and hopefully this video will help someone else with the same problem. (It is narrated so don't forget to turn up your audio!)

    By the way, the Help info says (emphasis added): "The File_Attribute parameter is a numeric value specifying the type of file to find. You can find files that have one or more of the following attributes:" but apparently that is not true - they have to be found one at a time.
    Last edited by CALocklin; 09-19-2009, 07:19 PM.

    #2
    Re: Filefind.get - archive bit issue.

    I just know I'm going to be looking for this in 6 months... thanks.

    Comment


      #3
      Re: Filefind.get - archive bit issue.

      Thanks Cal, A really good job done.

      Comment


        #4
        Re: Filefind.get - archive bit issue.

        Cal,
        Thanks....

        It does look like you can use
        FILE_FIND_NOT_DIRECTORY to find all files regardless of archive....makes a bit of sense that you cannot use FILE_FIND_ARCHIVE and FILE_FIND_NOT_ARCHIVE together as they negate each other.

        FILE_FIND_READONLY+FILE_FIND_ARCHIVE also works.

        I did not check out the other attributes yet.
        Mike
        __________________________________________
        It is only when we forget all our learning that we begin to know.
        It's not what you look at that matters, it's what you see.
        Henry David Thoreau
        __________________________________________



        Comment


          #5
          Re: Filefind.get - archive bit issue.

          Hi Cal and Mike,

          This road was traveled down many years ago, and unfortuately, it has not changed.

          There are 4 attributes associated with a file, Read-Only, Hidden, System and Archive bits. The value of 119 returns the most files, but not all values of attributes.

          Here are some examples of codes (and these were the best of the 65636 possibilities). Each text file has the attributes of the file's name. However there are 3 settings that are not returnable which are
          H-A -H-A.txt
          HSA -HSA.txt
          -SA --SA.txt
          The ones above may not be "important for most Alpha applications, but it is still a limitation.

          Code:
          ' There is no argument that returns the Read-only setting in the output,
          ' although it can be derived.
          
          ' This returns all 2 no read-only, no system, no hidden bits set
           ?filefind.get("C:\dirtest\*.txt",0,"-HSA N")
          = ---- ----.txt
          ---A ---A.txt
          
          ' This returns all 4 no read-only and with archive bit set
          ?filefind.get("C:\dirtest\*.txt",32+4+2,"HSA N")
          = --A ---A.txt
          H-A -H-A.txt
          HSA -HSA.txt
          -SA --SA.txt
          
          ' This returns all 8 with Read only attribute
          ?filefind.get("C:\dirtest\*.txt",4+2+1,"HSA N")
          = H-- RH--.txt
          --- R---.txt
          --A R--A.txt
          H-A RH-A.txt
          -S- R-S-.txt
          HS- RHS-.txt
          HSA RHSA.txt
          -SA R-SA.txt
          
          ' This one get's all 13.  Unknown why 64 causes attributes ---- to happen
          ?filefind.get("C:\dirtest\*.txt",64+32+16+4+2+1,"HSA N")
          = H-- RH--.txt
          --- ----.txt
          --A ---A.txt
          H-A -H-A.txt
          --- R---.txt
          --A R--A.txt
          H-A RH-A.txt
          HSA -HSA.txt
          -S- R-S-.txt
          HS- RHS-.txt
          HSA RHSA.txt
          -SA --SA.txt
          -SA R-SA.txt
          Regards,

          Ira J. Perlow
          Computer Systems Design


          CSDA A5 Products
          New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
          CSDA Barcode Functions

          CSDA Code Utility
          CSDA Screen Capture


          Comment


            #6
            Re: Filefind.get - archive bit issue.

            Originally posted by MikeC View Post
            It does look like you can use
            FILE_FIND_NOT_DIRECTORY to find all files regardless of archive
            Nice catch! That's definitely easier - and makes me feel silly for not discovering it in all these years. I guess I was stuck too deep in the rut of working out the archive issue. (Which became all the more of an issue with me when I was told that FILE_FIND_NORMAL would show everything with archive bit on or off - but it doesn't.)
            Originally posted by MikeC View Post
            ....makes a bit of sense that you cannot use FILE_FIND_ARCHIVE and FILE_FIND_NOT_ARCHIVE together as they negate each other.
            True - IF you think of it in the logic of the words. However, if you think of it in the same logic as adding numbers together where any combination will always total to a unique number (therefore you can "parse out" the individual numbers that were originally entered), then it should be possible. Plus, as noted above, the help text says, "The File_Attribute parameter is a numeric value specifying the type of file to find. You can find files that have one or more of the following attributes:" Then proceeds to list FILE_FIND_ARCHIVE and FILE_FIND_NOT_ARCHIVE along with all the rest.

            And, thinking of it in terms of adding numbers together, if this works:
            FILE_FIND_READONLY + FILE_FIND_ARCHIVE
            shouldn't
            FILE_FIND_ARCHIVE + FILE_FIND_NOT_ARCHIVE
            work also? (Just a rhetorical question - no response required.)

            And, this made me curious what the numbers were so I just ran the following in the Interactive Window. Any combination will indeed result in a unique number.
            ?FILE_FIND_NORMAL
            = 0
            ?FILE_FIND_READONLY
            = 1
            ?FILE_FIND_HIDDEN
            = 2
            ?FILE_FIND_SYSTEM
            = 4
            ?FILE_FIND_LABEL
            = 8
            ?FILE_FIND_DIRECTORY
            = 16
            ?FILE_FIND_ARCHIVE
            = 32
            ?FILE_FIND_AND_FLAGS
            = 128
            ?FILE_FIND_NOT_READONLY
            = 256
            ?FILE_FIND_NOT_DIRECTORY
            = 4096
            ?FILE_FIND_NOT_ARCHIVE
            = 8192
            ?FILE_FIND_AND_NOT_FLAGS
            = 32768

            Comment


              #7
              Re: Filefind.get - archive bit issue.

              Hi Cal and Mike,

              Originally posted by csda1 View Post
              However there are 3 settings that are not returnable which are
              H-A -H-A.txt
              HSA -HSA.txt
              -SA --SA.txt
              Correction: The 3 not possible are the above without the archive bit, as in
              H-- -H--.txt
              HS- -HS-.txt
              -S- --S-.txt
              Returns for the examples Cal listed are
              Code:
              ?filefind.get("C:\dirtest\*.txt",FILE_FIND_NOT_DIRECTORY,"HSA N")
              = --- ----.txt
              --A ---A.txt
              --- R---.txt
              --A R--A.txt
              
              ?filefind.get("C:\dirtest\*.txt",FILE_FIND_ARCHIVE,"HSA N")
              = "--A ---A.txt"
              
              ?filefind.get("C:\dirtest\*.txt",FILE_FIND_NOT_ARCHIVE,"HSA N")
              = --- ----.txt
              --- R---.txt
              
              ?filefind.get("C:\dirtest\*.txt",FILE_FIND_READONLY + FILE_FIND_ARCHIVE,"HSA N")
              = --A ---A.txt
              --- R---.txt
              --A R--A.txt
              
              ?filefind.get("C:\dirtest\*.txt",FILE_FIND_ARCHIVE + FILE_FIND_NOT_ARCHIVE,"HSA N")
              = ""
              Regards,

              Ira J. Perlow
              Computer Systems Design


              CSDA A5 Products
              New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
              CSDA Barcode Functions

              CSDA Code Utility
              CSDA Screen Capture


              Comment


                #8
                Re: Filefind.get - archive bit issue.

                Originally posted by csda1 View Post
                [code]...
                ' This returns all 2 no read-only, no system, no hidden bits set
                ?filefind.get("C:\dirtest\*.txt",0,"-HSA N")
                = ---- ----.txt
                ---A ---A.txt
                Ira, if I'm reading that correctly, you are saying that the 0 attribute (file_find_normal) returns two files for you - the one WITH the archive bit set and the one WITHOUT the archive bit set.

                If that is true, take another look at my video and explain why it doesn't work that way on my computer.

                It also didn't work that way on my previous two computers and it didn't work that way on at least some of my customer's computers. That's why this has been such an issue for me. At one point I even had Marcel Kollenar write me a DLL that I could use to set the Archive attribute for all files in a folder. That was the only way I was able to get the "normal" attribute to actually list all the files.

                Here are the results from today's test:
                Code:
                ?filefind.get("E:\a5v9\*.mpx",FILE_FIND_NOT_DIRECTORY,"HSA N")
                = --- test_archive_off.mpx
                --A test_archive_on.mpx
                
                ?filefind.get("E:\a5v9\*.mpx",0,"HSA N")
                = "--A test_archive_on.mpx"
                
                ?filefind.get("E:\a5v9\*.mpx",FILE_FIND_ARCHIVE,"HSA N")
                = "--A test_archive_on.mpx"
                
                ?filefind.get("E:\a5v9\*.mpx",FILE_FIND_NOT_ARCHIVE,"HSA N")
                = "--- test_archive_off.mpx"

                Comment


                  #9
                  Re: Filefind.get - archive bit issue.

                  Originally posted by CALocklin View Post
                  Ira, if I'm reading that correctly, you are saying that the 0 attribute (file_find_normal) returns two files for you - the one WITH the archive bit set and the one WITHOUT the archive bit set.

                  If that is true, take another look at my video and explain why it doesn't work that way on my computer.
                  Unfortunately, I can't explain it. I've run tests on A5v8 and A5v9 (beta'd to ver 10). I tried another computer, an XP Home edition and got the same result. It also did not matter whether on a network drive or local.

                  I tried repeating the test on my XP Professional system with an NTFS formatted drive (I was doing it on a FAT32 drive), but the results came up the same for me for either drive.

                  On the off chance that something else in the directory was causing it to respond that way, I created a directory with only 2 files, 1 archived, 1 not.
                  It still comes up with both.

                  Originally posted by CALocklin View Post
                  It also didn't work that way on my previous two computers and it didn't work that way on at least some of my customer's computers.
                  I can see why it would be confusing . The question is, why is it not consistent? I trust your methodology, and am also sure of mine, so it's got to be something else (maybe a virus checker, firewall or similar?) It certainly can't hurt concatonating the variations and eliminating the duplicates, but it would be good to know what's happening and why the inconsistency.

                  Did you try the setting with 119 or with setting the "64" value bit?

                  Have some code walk through the 65k combinations looking for the result with the greatest lines, or the greatest lines also containing the items desired. That's what I did.

                  Obviously 100% reliability and consistency is important in either case!
                  Regards,

                  Ira J. Perlow
                  Computer Systems Design


                  CSDA A5 Products
                  New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                  CSDA Barcode Functions

                  CSDA Code Utility
                  CSDA Screen Capture


                  Comment


                    #10
                    Re: Filefind.get - archive bit issue.

                    FOUND IT!

                    I had turned off the "indexing service" capability. I don't remember how - maybe a registry hack. I probably did it to speed things up just a little bit since I really didn't need that service for what I do.

                    Right below the "File is ready for archiving" checkbox is another checkbox for "For fast searching, allow Index Service to index this file". If that checkbox it unchecked, the FILE_FIND_NORMAL will not find it.

                    Comment


                      #11
                      Re: Filefind.get - archive bit issue.

                      Hi Cal,

                      Originally posted by CALocklin View Post
                      FOUND IT!

                      I had turned off the "indexing service" capability. I don't remember how - maybe a registry hack. I probably did it to speed things up just a little bit since I really didn't need that service for what I do.

                      Right below the "File is ready for archiving" checkbox is another checkbox for "For fast searching, allow Index Service to index this file". If that checkbox it unchecked, the FILE_FIND_NORMAL will not find it.

                      THAT'S GREAT!


                      Well at least that finds the setting that does it. Why? Who knows, but I sure wish it was more complete in finding all files and worked 100% as expected.
                      Regards,

                      Ira J. Perlow
                      Computer Systems Design


                      CSDA A5 Products
                      New - Free CSDA DiagInfo - v1.39, 30 Apr 2013
                      CSDA Barcode Functions

                      CSDA Code Utility
                      CSDA Screen Capture


                      Comment


                        #12
                        Re: Filefind.get - archive bit issue.

                        Thanks Ira, Cal. Nice to have alternate ways and an explanation of what was happening--I too had turned off the indexing as I did not want to "confuse" the issue. LOL so much for that idea!!
                        Mike
                        __________________________________________
                        It is only when we forget all our learning that we begin to know.
                        It's not what you look at that matters, it's what you see.
                        Henry David Thoreau
                        __________________________________________



                        Comment


                          #13
                          Re: Filefind.get - archive bit issue.

                          FWIW - I did more testing and found that the File_get_date_time() function is another function that will not work if both the archive bit and the "Indexing Service" are turned off. I'm guessing there may be other file functions that are also affected by this.

                          In other words, make sure "Indexing Service" is not turned off on your system.

                          If you think it's turned off and want to turn it back on, go to the WINDOWS control panel, select Add/Remove Programs, select Add/Remove Windows Components, and make sure that "Indexing Service" is checked.

                          NOTE: In versions of Windows prior to XP, I don't believe there is an "Indexing Service". In that case, File_get_date_time() may not work at all if the archive bit is off - I don't currently have an older system so I can't check it. I obviously also can't test the older systems to see if using FILE_FIND_NOT_DIRECTORY in Filefind.get() will return the files with the archive bit off - maybe; but I did a lot of testing back when and I'm pretty sure I checked it back then with no luck.

                          So, if you have to work with an older OS, check it yourself to be sure.
                          Last edited by CALocklin; 09-26-2009, 12:47 PM.

                          Comment


                            #14
                            Re: Filefind.get - archive bit issue.

                            In Windows 2000 you can control the indexing service by opening Windows Explorer and right clicking on the drive, choose properties and select the check box for the Indexing service.

                            Comment

                            Working...
                            X