Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / 'open to write' isn't creating file?

Author
Message
HyperByte
19
Years of Service
User Offline
Joined: 3rd Jan 2007
Location: in a small kola bear costume
Posted: 24th Mar 2012 09:45
I keep trying the "open to write" command in my new program and it doesn't create a new file... it writes the information (i.e. it doesn't crash when the command is called to write stuff to it) but the actual file doesn't appear in the folder its created in like it should be. I've obviously tried all the usual stuff like refreshing and trying different file names... any ideas?

On a scale from one to ten one being very smart and ten being an absolute genius your none of the above
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 24th Mar 2012 11:39
PLEASE DO THE FOLLOWING...

STATE YOUR OS AND SYSTEM SPEC INCLUDING BIT VERSION [32/64]

AND ALSO YOUR CODE THAT YOU ARE USING TO PERFORM THE FILE CREATION...

it helps us to help you

And Hiya I think its the first time I have met you around here

returning are we?

Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 24th Mar 2012 13:14
Quote: "'open to write' isn't creating file?"


it is creating new file..
but since you dont have any code here to show, i cant help you any feather..

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 24th Mar 2012 15:04
Have you tried using close file after writing to it?
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 24th Mar 2012 15:07
revenant chaos, you may have as well just asked if he used SAVE FILE...

Eitherway we are awaiting his response... [we all wait patiently holding hands around a candle lit table... and then suddenly realise we got bored of the 70's and pull out our paint ball guns and run in different directions... I AM RED!]

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Mar 2012 15:43 Edited at: 24th Mar 2012 15:44
The command doesn't create the file until you use close file. There are cases where if you're writing a lot of data to the file, it will start to dump the data to disk and the file will appear, but that's probably irrelevant in this case.

Always use close file!



TheComet

Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 24th Mar 2012 17:58
also worth noting that open to write will fail if the specified file already exists. It won't crash, it just won't actually write anything.

Westmere
16
Years of Service
User Offline
Joined: 12th Mar 2010
Location: Germany
Posted: 26th Mar 2012 16:46
Also woth noting: If you are using UAC (default in Win Vista, 7 and 8) you cannot write a file in the Program Files directory or it's subdirectories unless you are running your program as administrator.

(This caused me some headache some time ago)


MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 26th Mar 2012 17:08
Seriously guys let the OP reply before going on and on...

Login to post a reply

Server time is: 2026-07-10 08:48:52
Your offset time is: 2026-07-10 08:48:52