Liberty BASIC Community Forum
« Multi user programs »

Welcome Guest. Please Login or Register.
Sep 19th, 2017, 1:51pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: Multi user programs  (Read 1204 times)
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Multi user programs
« Reply #15 on: Sep 19th, 2016, 8:11pm »

Code:
Print "Attempting to open test document on SysInternals share."
Print "This may take a while, depending on your internet connection..."
Print
hFile = OpenFileForInput("\\live.sysinternals.com\Tools\About_This_Site.txt")
print hFile

while not(isEOF(hFile))
    a$ = InputLine$(hFile)
    Print a$
wend

a = CloseFile(hFile)  


Thanks Chris,

Ive had a play with this and for some reason it does not work for me, I get this number 4294967295 returned on both Linux and Win10 for each different file location

even across my home network, I am trying to read from a file on my linux machine so I changed to this line
Code:
hFile = OpenFileForInput("smb:\\MINT\Documents\fgmvol.txt") 


not sure if I'm missing something
User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
Chris Iverson
Administrator
ImageImageImageImageImage


member is offline

Avatar

20% Cooler


Homepage PM

Gender: Male
Posts: 2278
xx Re: Multi user programs
« Reply #16 on: Sep 20th, 2016, 7:19pm »

I'm surprised that the sysinternals one wouldn't be working, but for your Samba share on Linux, don't include the smb: protocol specifier. That's only used on Linux.

Just \\MINT\Documents\fgmvol.txt should do it.

If it doesn't, try mounting \\MINT\Documents using Windows to see if it actually connects.

If it doesn't, use PING to try to see if it can address MINT on the network. If it can't, you'll have to either use the IP address of the server, or edit the hosts file on your Windows PC to include MINT. (Some routers will set up DNS between network computers, others won't.)
User IP Logged

"Do you believe in destiny?" - Pyrrha Nikos, RWBY
"With what wish will your Soul Gem shine?" - Kyubey, Puella Magi Madoka Magica
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Multi user programs
« Reply #17 on: Sep 21st, 2016, 12:12am »

thanks Chris,
I mounted "\\MINT\Documents\CODE" within windows then changed the file I want to read to
Code:
hFile = OpenFileForInput("\\MINT\Documents\CODE\lastprice.txt") 


and got an error pop-up (same error if I use the IP of the MINT system) but no error when attempting SysInternals, just no result
Code:
Error log timestamp Tuesday 20-09-16 08:19:08 AM

Runtime error: "isEmpty" not understood

MessageNotUnderstood>>defaultAction
MessageNotUnderstood(Exception)>>activateHandler: <anUndefinedObject> 
MessageNotUnderstood(Exception)>>handle
MessageNotUnderstood(Exception)>>signal
MessageNotUnderstood class>>message: <aMessage> 
UndefinedObject(Object)>>doesNotUnderstand: <aMessage> 
BasicProgram>>terminateRun: <aMessageNotUnderstood> 
[] in BasicProgram>>errorHandlerBlock
ExceptionHandler>>evaluateResponseBlock: <aBlockClosure> for: <aMessageNotUnderstood> 
[] in ExceptionHandler>>handle:
ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
BlockClosure>>invisibleEnsure: <aBlockClosure> 
ExceptionHandler>>handle: <aMessageNotUnderstood> 
ExceptionHandler>>findHandler: <aMessageNotUnderstood> 
MessageNotUnderstood(Exception)>>activateHandler: <anExceptionHandler> 
MessageNotUnderstood(Exception)>>handle
MessageNotUnderstood(Exception)>>signal
MessageNotUnderstood class>>message: <aMessage> 
SmallInteger(Object)>>doesNotUnderstand: <aMessage> 
SmallInteger(Object)>>perform: <#copyToExternalMemory> 
BasicStructure>>atField: <'a.b'> put: <0> 
BasicProgram>>assignField: <'a.b'> toBe: <0> 
[] in LetCommand>>assignField:toBe:
[] in BasicProgram>>begin
ExceptionHandler>>evaluateProtectedBlock: <aBlockClosure> 
[] in ExceptionHandler>>activateDuring:
ProtectedFrameMarker(BlockClosure)>>setUnwind: <aBlockClosure> 
BlockClosure>>invisibleEnsure: <aBlockClosure> 
ExceptionHandler>>activateDuring: <aBlockClosure> 
ExceptionHandler class>>handle: <anError class> with: <aBlockClosure> during: <aBlockClosure> 
BlockClosure>>on: <anError class> do: <aBlockClosure> 
BasicProgram>>begin
BasicProgram>>run
[] in BasicSourcePane>>run
BasicCompiler class>>compileFromString: <' Print "Attempting t...'> notify: <aBasicSourcePane> ifSuccess: <aBlockClosure> 
BasicSourcePane>>run
BasicSourceWindow>>run
BasicEditorModel>>run: <aToolbarButton> 
BasicEditorModel(Object)>>perform: <#run:> with: <aToolbarButton> 
ToolbarButton>>triggerClickedEvent
Message>>perform
NotificationManager>>runPendingEvents
NotificationManager>>runEventLoop
Message>>perform
Message>>evaluate
Process>>safelyEvaluate: <aMessage>  
User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
Chris Iverson
Administrator
ImageImageImageImageImage


member is offline

Avatar

20% Cooler


Homepage PM

Gender: Male
Posts: 2278
xx Re: Multi user programs
« Reply #18 on: Sep 21st, 2016, 8:29pm »

Oh, shoot, that's my fault.

I made a change to a couple of the existing functions, but I forgot to put those changes up, I just posted the new ones.

Replace the existing WriteFile() and ReadFile() with these, and it should work.

Code:
Function ReadFile(hFile, byref lpBuffer$, nNumberOfBytesToRead, byref lpNumberOfBytesRead, lpOverlapped)
    struct a, b as long
    a.b.struct = lpNumberOfBytesRead

    CallDLL #kernel32, "ReadFile",_
    hFile as ulong,_
    lpBuffer$ as ptr,_
    nNumberOfBytesToRead as long,_
    a as struct,_
    lpOverlapped as ulong,_
    ReadFile as long

    lpNumberOfBytesRead = a.b.struct
End Function 


Edit: changed again. Just ReadFile() should be updated. I need a better system of keeping track of my changes.
« Last Edit: Sep 21st, 2016, 9:47pm by Chris Iverson » User IP Logged

"Do you believe in destiny?" - Pyrrha Nikos, RWBY
"With what wish will your Soul Gem shine?" - Kyubey, Puella Magi Madoka Magica
Jim Hiley
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 202
xx Re: Multi user programs
« Reply #19 on: Sep 21st, 2016, 9:28pm »

It works well for my local network but fails with 4294967295 (-1) for the sysinternal site.
I expect that my router is not playing nice. I do have it set fairly tight.

Jim
User IP Logged

Chris Iverson
Administrator
ImageImageImageImageImage


member is offline

Avatar

20% Cooler


Homepage PM

Gender: Male
Posts: 2278
xx Re: Multi user programs
« Reply #20 on: Sep 21st, 2016, 9:35pm »

That's most likely it. Quite honestly, for vulnerability blocking reasons, it wouldn't surprise me if a consumer router or ISP blocked outgoing SMB connections.

Worth a shot, though. And it was a known quantity, which can be useful.
User IP Logged

"Do you believe in destiny?" - Pyrrha Nikos, RWBY
"With what wish will your Soul Gem shine?" - Kyubey, Puella Magi Madoka Magica
metro
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 194
xx Re: Multi user programs
« Reply #21 on: Sep 22nd, 2016, 07:57am »

thanks Chris, all good
Quote:
I need a better system of keeping track of my changes.

wait till you're over 60 and you'll be writing notes for yourself every day grin
User IP Logged

Win10 64 HP laptop + desktop Mint Linux 64bit
Gidiom2
New Member
Image


member is offline

Avatar




PM


Posts: 15
xx Re: Multi user programs
« Reply #22 on: Sep 22nd, 2016, 1:46pm »

on Sep 22nd, 2016, 07:57am, metro wrote:
thanks Chris, all good

wait till you're over 60 and you'll be writing notes for yourself every day grin


Over 70 and you'll be wondering why you wrote the notes! rolleyes
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls