News:

  • May 22, 2024, 09:29:41 AM

Login with username, password and session length

Author Topic: FileQuery for A Directory  (Read 1198 times)

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2121
  • YKPAIHA
    • ATU, Inc.
FileQuery for A Directory
« on: February 22, 2024, 06:03:57 PM »
What is the proper way to check for the existence of a directory on the root of the SDcard?  I tried it with the "\" and without and it still gives me a file doesn't exist.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: FileQuery for A Directory
« Reply #1 on: February 22, 2024, 08:29:00 PM »
What is the proper way to check for the existence of a directory on the root of the SDcard?  I tried it with the "\" and without and it still gives me a file doesn't exist.
"\MyFolder" should work.  No trailing backslash.

Did you see the example in the Help for FILEQUERY?  Make sure the SD card media is installed and mounted (see logic in Stage S0).

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2121
  • YKPAIHA
    • ATU, Inc.
Re: FileQuery for A Directory
« Reply #2 on: February 22, 2024, 09:27:15 PM »
I did exactly that. I created the directory fine, I just wanted to verify it was there. The instruction fails and I get a System warning, File not Found, but bit 4 is turned on for the returned attributes. What boxes need to be checked in the instruction?
« Last Edit: February 22, 2024, 09:29:48 PM by ATU »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: FileQuery for A Directory
« Reply #3 on: February 22, 2024, 10:04:59 PM »
I did exactly that. I created the directory fine, I just wanted to verify it was there. The instruction fails and I get a System warning, File not Found, but bit 4 is turned on for the returned attributes. What boxes need to be checked in the instruction?
I would not think any, but maybe that's the issue?  File Attributes should show it's a Directory, so check that.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2121
  • YKPAIHA
    • ATU, Inc.
Re: FileQuery for A Directory
« Reply #4 on: February 26, 2024, 03:27:21 PM »
What am I doing wrong? The  folder is there, it is empty. I only want to verify that the folder exists. File Attributes say it is a directory, yet the FILEQUERY instruction fails and throws a system warning that the file does not exist. See the attachments. I haven't worked on this is 2 years, so I probably am forgetting something.  I also checked the strings, I don't see any NULLS or spaces at the end

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3666
    • Host Engineering
Re: FileQuery for A Directory
« Reply #5 on: February 26, 2024, 04:01:58 PM »
Stick a file in that folder and see if FILEQUERY "succeeds"

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2121
  • YKPAIHA
    • ATU, Inc.
Re: FileQuery for A Directory
« Reply #6 on: February 26, 2024, 04:55:52 PM »
Nope, same fault