Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
FOPEN does not recognise file opened with other applicat
Message
 
To
02/09/2004 13:44:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00938799
Message ID:
00938907
Views:
20
Ravi, You can use low level functions from VC++ Runtime
DECLARE LONG  fopen IN msvcrt20.dll AS _fopen STRING @, STRING @
DECLARE LONG  fclose IN msvcrt20.dll AS _fclose LONG
DECLARE LONG  fprintf IN msvcrt20.dll AS _fprintf LONG, STRING, STRING
DECLARE LONG  fwrite IN msvcrt20.dll AS _fwrite STRING @, INTEGER, INTEGER,  LONG
DECLARE LONG  _open IN msvcrt20.dll STRING @, INTEGER, INTEGER
DECLARE LONG  _close IN msvcrt20.dll LONG

liFile = _fopen( m.lcFile, ("at") ) &&  Add text to end file
IF m.liFile>0
   _fprintf(m.liFile, "%s", m.lcText)
   _fclose(m.liFile )
ENDIF
MartinJ


>Thanks to everyone for the useful suggestions, particularly that Notepad does not keep the file open. On further testing, I found that FOPEN() with read-write option can be used to confirm if the file is not open elsewhere. I am sure that I will be able to use the suggestions to solve the problem.
>
>- Ravi
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Reply
Map
View

Click here to load this message in the networking platform