QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: badger on October 07, 2020, 02:55:25 pm
-
Hello
i was wonder why the following code does not create the directory.
Badger
iflag is an integer
iflag
= _DIREXISTS("c:\program files\jbridal\data")
IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data"
-
Do you need to MKDIR “c:\program files\jbridal” first?
-
SMcNeill
here is the whole module i guess i should have posted this in the first place sorry
but jbridal does exists program will end if not there.
dircheck:
idirflag = -1
idirflag = 0
PRINT "Home Director Does not Exists" LOCATE 13, 23:
PRINT "Please Create c:\program files\jbridal"
iflag
= _DIREXISTS("c:\program files\jbridal\data")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data"
iflag
= _DIREXISTS("c:\program files\jbridal\data\custdesc")IF iflag
= 0 THEN MKDIR "c:\program file\jbridal\data\custdesc"
iflag
= _DIREXISTS("c:\program files\jbridal\data\invdesc")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\invdesc"
iflag
= _DIREXISTS("c:\program files\jbridal\data\posdesc")
IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\posdesc"
-
SMneil
I modified what i posted here is the modified module
Badgerdircheck:
PRINT "Home Director Does not Exists" LOCATE 13, 23:
PRINT "Please Create c:\program files\jbridal"
dirchk1:
iflag
= _DIREXISTS("c:\program files\jbridal\data")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data"
iflag
= _DIREXISTS("c:\program files\jbridal\data\db")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\db"
iflag
= _DIREXISTS("c:\program files\jbridal\data\custdesc")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\custdesc"
iflag
= _DIREXISTS("c:\program files\jbridal\data\invdesc")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\invdesc"
iflag
= _DIREXISTS("c:\program files\jbridal\data\posdesc")IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data\posdesc"
-
Hello
i was wonder why the following code does not create the directory.
Badger
iflag is an integer
iflag
= _DIREXISTS("c:\program files\jbridal\data")
IF iflag
= 0 THEN MKDIR "c:\program files\jbridal\data"
Windows has some new rules about access to your own dang computer ie no access allowed to Program files, at least through QB64 to make a directory.
Try this to get the working directory you are allowed access:
Paste into IDE and make a directory off that. I did that after not being allowed access c:\program files to add bplus folder through QB64.
-
Or use C:/ProgramData/ That’s where most read/write data access is stored for programs usually.
-
SMcNeill
thanks i will try all to see what i can get done
Badger
-
SMcNeill
something i was doing wrong. I had to move qb64 to the c:\program files\jbridal directory then it work fine anc created all the directories i needed.. but i had to run qb64 in admin mode
Badger
-
I would NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER put any of my big programs in the Windows program files folder. I always name my project then I make a folder on my hard drive using that name.
Why? So some dumb-ASCII Windows Update is less likely to mess them up if such an update were to mess with Windows folders. Also, to avoid running as admin, etc., or any other restrictions.
Pete
-
I would NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER, NEVER put any of my big programs in the Windows program files folder. I always name my project then I make a folder on my hard drive using that name.
Why? So some dumb-ASCII Windows Update is less likely to mess them up if such an update were to mess with Windows folders. Also, to avoid running as admin, etc., or any other restrictions.
Pete
+1
Windows has a set structure to it. Program Files isn’t the place to be read/writing to. Use ProgramData or User/AppData instead. You’ll think yourself later, with all the issues from folder permissions you won’t be having.
-
Hello
I think i get the messages LMBO. I moved it all to my home directory c:\users\sureshot\jbridal.
here is a question is there away to bring in the present path so the program knows what the home directory is called
Badger
-
Hello
after some reading i think _csd$ is my cause thanks guys
Badger