I must be doing something really stupid. Just wanted to create a zero length file.
Last edited by Randy Walker on Tue Apr 15, 2025 2:17 am, edited 1 time in total.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
Just to illustrate that I never knew what I was doing. I found code in my main project that queries the system to find out whether or not the system uses NTFS. I set up a global variable to hold the results, but I searched through the whole program and found out that nowhere in the program do I use that information for anything. Even now I can't imagine what use that might have been for anything.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
SetCurrentDirectory("C:\")
Debug GetCurrentDirectory()
Global Name$ = GetCurrentDirectory()+"junk.jnk"
If CreateFile(0,Name$,#PB_Ascii)
CloseFile(0)
Else
MessageRequester("nope","not created")
EndIf
Tried it with and without Global, which shouldn't be required anyway -- same results.
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
I'm guessing now something in the system is blocking me from writing to C:\
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
idle wrote: Tue Apr 15, 2025 1:39 am
you need the qualified path eg "c:\test.jnk" or
I get it now -- you said "Qualified path", however C:\ is not a qualified path.
So replacing C:\ with Get TemporaryDirectory() Did the trick.
THANKS Idle !!!
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.
idle wrote: Tue Apr 15, 2025 1:39 am
you need the qualified path eg "c:\test.jnk" or
I get it now -- you said "Qualified path", however C:\ is not a qualified path.
So replacing C:\ with Get TemporaryDirectory() Did the trick.
THANKS Idle !!!
since win 7 you needed to raise privileges to write to protected directories, we can do that for programs by compiling them with the compiler option "Request Administrator mode for Vista and above"
idle wrote: Tue Apr 15, 2025 1:39 am
you need the qualified path eg "c:\test.jnk" or
I get it now -- you said "Qualified path", however C:\ is not a qualified path.
So replacing C:\ with Get TemporaryDirectory() Did the trick.
THANKS Idle !!!
since win 7 you needed to raise privileges to write to protected directories, we can do that for programs by compiling them with the compiler option "Request Administrator mode for Vista and above"
Yeah, I didn'tealize drive C root directory was restricted. I knew some folders there were but not C:\ itself.
I did say "I must be doing something really stupid."
- - - - - - - - - - - - - - - -
Randy
I *never* claimed to be a programmer.
Nothing is faster, more stable, or easier to maintain than code that doesn’t exist.