Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing files using Racket

Tags:

scheme

racket

I want to make a DrRacket program that can copy all of the files from a given directory (taking it off of a USB Camera (when it's plugged in it's seen as a mass storage device)) and paste them into a folder on my computer's hard drive. For whatever reason I'm unable to figure out DrRacket's implementation of a path on the computer (ie. for the Desktop on a Windows Machine it would be: C:\Users\Mike\Desktop) I read the help desk and still can't figure this out. Any suggestions as to where I should look to clear up my confusion? I think the function call that I'll need to implement this idea is:

(copy-directory/files src dst)

After I figure that out I'm going to work on a GUI for it so it operates at the click of a button.

like image 591
user1101160 Avatar asked Jan 25 '26 07:01

user1101160


1 Answers

You may be looking for the content about paths. You can create a path using build-path. A lot of the path-manipulating functions, though, can take strings as well. So you should be able to say something like:

#lang racket
(copy-directory/files "C:\\Users\\Mike\\Desktop\\..." ...)

with the ... replaced appropriately.

like image 79
dyoo Avatar answered Jan 28 '26 18:01

dyoo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!