Understood. Will give it another try.
Thanks
I tried to compile the code on both client and server but got on error on each
one.
nim-1.6.10libpureconcurrencythreadpool.nim(22, 10) Error: Threadpool requires
--threads:on option.
I thought this might be a missing module but not finding any module problem. I
will continue to check this.
I will load it tonight and take a closer look. Thanks.
Looks great! My only concern is firewall issues. The big advantage of reverse
is it has no firewall problems. When helping a user it might be difficult to
walk them through the process of setting this to go through their firewall.
Have you been able to get this to work with the reverse format?
Looks good. Just need to understand how to implement spawn into the original
code. Will this help to return control from download to main? Thanks for the
input
When asked about the tool category, I’d put it into a type of support tool. Of
course this type of tool never starts robust, and that’s fine. Robustness comes
with time, not at the beginning. Thank you for your efforts.
Good morning (I'm in mountain time -Utah).
As a follow-up on the purpose of this tool -
You are correct, "remote support" is what I had in mind. Nothing nefarious. The
reason for reverse client /server is that you don't need to worry about the
firewall. The admin would just need to setup port f
I will take a look. If you have time Tomorrow please take a look. Thank you for
your help on this. I really appreciate it.
Just a quick follow up with some testing I've done. If I insert the
"stdout.write("Enter a command") along with "let input: string =
strdin.readLine() and the input criteria, I can get a prompt again. However, it
seems to work fine for other commands but the download command still has the
same
Hey, that seemed to get it a little further than before. I am now getting the
echo from the "Returning back to the main loop."
if input.startsWith("download "):
var get_name = input[9..^1]
let (dirPath, fileName) = splitPat
Anything would help. If you have some time next week to play with this, that
would be highly appreciated. There is not timeline, just a hunger for knowledge
and how this all works. It's the knowledge not the time. Thanks. All
appreicated.
Made the requested changes but not seeing a return back to the main loop. Also
put an echo after calling the serve() function, - echo "Returning to the main
loop.". Not seeing that echo either.
The loop comes to an end but still not able to get back to the main program
loop.
Updated Client-
Thanks so much. I will try exactly that and see if it resolves the problem. The
code works well except not getting back to the main loop to continue making
requests. (:
Thanks. I was thinking about removing the function and putting it in the loops
to have better control of it. I think I will however on the server have a
callable function so it can be used by multiple blocks of code.
I am able to download a file via sockets between the client / server
successfully, however, after making the function call (proc), for the download
of the file, I am pulled out of the loop of the Main program and am not able to
return back into the loop of the main program. I need some guidance
Thank you for helping. I really appreciate it.
Essentially I’m just trying to get some simple examples of a file transfer in
nim. Reading the file and send. Then receiving the file and write to disk.
Good day all. I am more on the experienced side of Python and have written some
successful file transfer applications (in python). However, I am struggling to
find sufficient information or examples on how to do the same in nim. I have
taken my code that I had done in Python and have attempted t
I see. Great!! It's working. I was sure Yesterday my code was going to work
because it looks right. I really appreciate the insight and knowledge you have.
I changed all the "[0..]" slices to "startsWith". Works perfectly now. I will
keep listening to you. Thanks again!
Here is a copy of the current client / server. The stand alone version works
great. Appears to only have a problem when implemented into the server side
when trying to use "elif" or "startswith" to initiate its execution. I put the
screenshot code block in the server twice seeing that startswith
I have tested this by itself and it works great. When I implement it in client
/ server, i can get it to respond.
Code -
elif input.startsWith("scr"):
var powershell: string = "powershell.exe"
var command = "Add-Type -Asse
Thanks I appreciate it. I plan on adding file transfer in the code. Moving
files is essential.
I've kept the reverse client / server format rather than the typical format.
I've been able to improve it somewhat thanks to examples by members of the
forum. Highly appreciated.
Client Update -
import net
import strutils
var server: Socket = newSocket()
se
Wow. Okay, I should have noticed the try outside the loop. Now works great.
Thanks for your help. How did you learn sockets well? Any recommended books or
websites? I do well with python but just started with nim. Wish to learn well.
This code works very well the first time but it disconnects only after one
time. Tried to fix it but not finding the reason for the disconnect. But works
great the first time.
The reverse of client and server was intentional. It was just an easier way for
me to connect to my other machine. Thanks for all the help. I really appreciate
it.
Wow! Checking this out. Thanks for the update. I really appreciate it.
That resolved the problem. Now I can get all the lines of data for each
request! Here is the changes I made to both the client and the server.
SERVER
if input[0..3] == "path":
var resp = newSeq[string]()
let my_path = input[5..^1]
My main concern was size. Raw sockets are small so that is my motivation. Not
very familiar with Jester. How does it compare compiled size wise when doing
the same in raw sockets? Thanks for the suggestions and information.
Thanks, I agree that writing it down helps to better implement the steps in
code.
1. When doing the for loop insert a variable to get number of folder items.
2\. Two variables num_of_dir@dir_list Create a separator character.
3. When on client side use num, dirs = split(“@“)
4\. With a
I think a for loop when requesting from server can be sent back to the client
for the number of need loops and then run a for loop on the with the incoming
data for that number of times.
Example code:
import os
echo "Please enter a directory path > "
let input_dir_path
Thanks, I will give it a try. Hopefully I can come up with something effective.
Appreciate your help.
I have fix the problem of just getting one line but its cause a different
problem. I used a while loop to get all the lines, however, now I am knocked
out of the original loop and loose the ability to continue making other
requests.
UPDATED CODE that gets multiple lines but looses ability to ma
Trying to get a list of file / folders to load from client to server, however,
if the requests are longer than one line, it only shows the first line. Tried a
for loop but not working correctly. Only the path request is having a problem.
All others requests work because they are one line respons
Chat gpt is not the best at nim (not yet anyway). But quite good at Python. It
has a lot more data about python, hence the reason for better performing code.
Hey, got it working. Thanks for making me think betterlol.
Here is what I was able to come up. Not the prettiest but its working.
if input[0..3] == "path":
var my_path = input[5..^1]
for entry in walkDir(my_path):
le
Thanks, I appreciate it. No worries about being honest.
I am trying to send a directory listing over sockets but getting an error.
Please help.
Example remote string being sent: The keyword, "directory" is cut out and only
the directory path is fed into the userInput variable. The intent is to have
the directory listing of both directories and files
Thanks for all the great help. Highly appreciated.
Need to the sub-directories names and file names in that directory to a
variable.
Here is the example in python.
import os
user_input = input("Enter a directory > ")
file_path = os.listdir(user_input)
print(file_path)
output:
Enter a dire
Wow! Thanks for the help.
Wow, I see. That helps a ton!
Thanks for the help.
Thanks for the help. Appreciated.
I am trying to slice a section of a string to obtain a specific section of that
string.
Here is an example in Python:
import os
my_string = "filesizec:\\users\\nate\\desktop\\thepark.jpg"
new_string = my_string[8:]
print(new_string)
file_size = os.path
When sending or receiving strings in nim, I'm not sure how to slice the part of
the string I want to use.
Example in python:
import os
enter_some_characters = input(str("Enter a string of 10 characters > "))
first_group_of_characters = enter_some_characters[:5]
I've been looking for a module to help me take a screenshot of my
desktop(entire screen). I haven't been able to find anything but I am sure that
it exists. Any information or line or snippet would be very helpful. I just
want to take a screenshot of my computer and then save it as an image (png
Thank you for the information and the help. I appreciate it.
I noticed when using user input, the cursor always shows below the request for
the user to input information. Not sure I'm placing this so it should request
on the same link as the user input -
Example:
import os
while true:
echo "Enter a file path > "
I am trying to create a simple application that captures the desktop screen,
however, not able to find much information about how to do this. I have been
looking for some time and have had no luck. Please help. Please see the code
below.
import winim
let window = FindWindow("Window Title", nil
Thanks, that solved the problem!
import strutils
var names = "nate@john@sally" let name_list = names.split('@') let name1 =
name_list[0] let name2 = name_list[1] let name3 = name_list[2]
echo name1 echo name2 echo name3
There must be a way to save to values and separate them with a character such
as @ then after sending it via sockets to the client to split it and extract
those values. variable1@variable2 newvar, newvar2 = variable.split("@")
Here is my working python code that Im trying to replicate in nim. Getting an
error.
Working python code -
#Collect information from user input.
old_file_name = input("Enter the path and name of the file name to change >")
new_file_name = input("Enter the new file name >")
#Create an fstring
wow, thanks. I will give it a try. Highly appreciated.
Thanks. Will try this. Very much appreciated.
Running on windows 10. Installed nim and has been working for some projects.
However, I tried to do a simple server using sockets and it's getting an error.
See below for full error.
C:UsersusernameDownloadsnimnim-1.6.10bin>nim c --run
"c:usersusernamedocumentsnimcodeserver.nim Hint: used confi
Created a simple code with sockets but when compiling I get an error that
socket not found. Tried to use nimble install but the links for the socket
module are dead(404). This is on a windows system. Later I’ll setup Linux which
is better for nim but for the present, I need to use windows os. Pl
56 matches
Mail list logo