get name of flashdrive.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
get name of flashdrive.
Hi all,
Is it possible to get the name of the USB stick that a livecode stack is on and put it into a field within the stack ?
Is it possible to get the name of the USB stick that a livecode stack is on and put it into a field within the stack ?
Re: get name of flashdrive.
Casbah
There is a function, "the volumes" that returns all mounted, er, volumes. Identifying a particular volume that happens to contain the name of a certain liveCode stack is another task.
But if you are already looking for a stack with a certain name, then why do you need to find it somewhere? Why not just put that name into the field?
There is more here, eh?
Craig
There is a function, "the volumes" that returns all mounted, er, volumes. Identifying a particular volume that happens to contain the name of a certain liveCode stack is another task.
But if you are already looking for a stack with a certain name, then why do you need to find it somewhere? Why not just put that name into the field?
There is more here, eh?
Craig
Re: get name of flashdrive.
Hi,
I'm trying to make a security measure (of sorts). Basically, I have a stack on a USB stick. This can be copied, so, to try to stop that, I want the stack to run after checking a field, the contents of which match the name of the USB stick, and if there is no match, the stack won't run. So I have to find a way that the stack can check if the name of the USB stick it's copied to will match. For that to happen the stack must have some code that will get the name of the USB stick, if there is a name.
A simple task for you, surely ?? (being ironical here).
I'm trying to make a security measure (of sorts). Basically, I have a stack on a USB stick. This can be copied, so, to try to stop that, I want the stack to run after checking a field, the contents of which match the name of the USB stick, and if there is no match, the stack won't run. So I have to find a way that the stack can check if the name of the USB stick it's copied to will match. For that to happen the stack must have some code that will get the name of the USB stick, if there is a name.
A simple task for you, surely ?? (being ironical here).
Re: get name of flashdrive.
The filename of the stack should include the volume name.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: get name of flashdrive.
Hi Jacque,
Thanks, but - I'm a bit lost..What's a volume name? and how would it work (in simple logic terms, if that's possible..)
Thanks, but - I'm a bit lost..What's a volume name? and how would it work (in simple logic terms, if that's possible..)
Re: get name of flashdrive.
Put this in a button or handler in your stack:
Code: Select all
put the filename of this stack
In the real script you'd get the filename and check if the right name is in there without using the message box of course.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: get name of flashdrive.
Many thanks, Jacque, It's a bit late now, but I'll try it tomorrow (if circumstances allow..).
Once again, many thanks.
Once again, many thanks.
Re: get name of flashdrive.
There is a very old thread on the topic of interrogating volumes on Windows.
I don't know whether any of it still applies.
viewtopic.php?t=2357&start=0
I don't know whether any of it still applies.
viewtopic.php?t=2357&start=0
Re: get name of flashdrive.
Hi Jacque,
I tried that - it's exactly what's needed, so my heartfelt thanks to you.
Thanks also to the other contributors for their kind concern.
I tried that - it's exactly what's needed, so my heartfelt thanks to you.
Thanks also to the other contributors for their kind concern.
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: get name of flashdrive.
Does Windows now identify volumes by name rather than letter designation?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: get name of flashdrive.
Windows has always used volume names. Those volumes may or may not be assigned a drive letter.
Re: get name of flashdrive.
Jacque.
Always impressed by your LC knowledge.
The "filename of stack". Really. What will they think of next??
Craig
Always impressed by your LC knowledge.
The "filename of stack". Really. What will they think of next??
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: get name of flashdrive.
In file paths, such as the value returned from "the long name of this stack"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: get name of flashdrive.
That wasn't what I was answering. Windows uses volume names for drive referencing (by humans). LiveCode returns a resolved file path on Windows which invariably has a drive letter.
-
- VIP Livecode Opensource Backer
- Posts: 9960
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: get name of flashdrive.
Yes, that was my concern about the solution the OP is considering.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn