forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Detect MemCard volume

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Feb 14, 2008 12:00 am    Post subject: Detect MemCard volume Reply with quote

I made this post and lost it some how, I try again - sorry...

I tried @volinfo( and @file( to detect my memcard volume.
But I get a MS drive not ready type error.

Does anyone know how to get around this error?
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Feb 14, 2008 3:19 pm    Post subject: Reply with quote

What I meant to say was, I need to detect if my memory stick is inserted in the USB2 memcard reader.
I want my DriveDetector program to to tell me when I left it inserted so I can pull it out while online.

I seen this at a website, dont know if its anyhelp detecting.
You can use the RequestDeviceNotifications() API with P/Invoke

Heres the error I get:


I tried some experiments in the DOS box but they bring the same ugly dialog up.
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Feb 14, 2008 6:51 pm    Post subject: Reply with quote

I found a good answer thanks to CodeScript and his FileFolderTouch DSU.

Below is smooth with no popup error box, make sure the file is on the MemCard:
Code:
#INCLUDE C:\DSU\FileFolderTouch.dsu
#DEFINE FUNCTION,FILEINFO
%F = @shortname(D:\memchk.txt)
%C = @FILEINFO(GET,MODIFIED,%F)
IF %C
 info MemCard inserted@CR()%C
ELSE
 info MemCard NOT inserted!
END
:CLOSE
EXIT


IMPORTANT:
Make sure to use the @shortname() on the target file.
I made mine HIDDEN and READONLY and included
explaination text inside the file itself.

Thanks CodeScript
Back to top
View user's profile Send private message Visit poster's website
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Mon Feb 18, 2008 12:05 am    Post subject: Reply with quote

to vtol

For a similar task (and primarily to getting some text to the table Very Happy ) I use this code:

Code:
list loadfile,TABLE2,D:\test\data.txt
if @not(@ok())
  warning ...
   ...


(that file (data.txt) is on the USB-Flash memory)

_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Mon Feb 18, 2008 8:44 am    Post subject: Reply with quote

vtol wrote:
I found a good answer thanks to CodeScript and his FileFolderTouch DSU.

I'm a little confused Rolling Eyes

After a little searching I realised that FileFolderTouch.DSU was actually a part of CodeScript's Set_date_time-XP.zip (available on Codescript's website). The included FileFolderTouch.DSU is 10KB and has a modified date of 25th Aug 2003.

But, from somewhere, I have downloaded just the FileFolderTouch.DSU file with no other files. It is 31KB and has a modified date of 14th Sep 2005.

Where did this 2005 version come from?
What's different compared to the 2003 version?
And where can I get a readme for the 2005 version?

_________________
cheers

Dave
Back to top
View user's profile Send private message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Mon Feb 18, 2008 9:04 pm    Post subject: Reply with quote

Dont know DaveŽ
Mine has 2003 creation date with little readme information:

File/Folder Touch XP By CodeScript
===============================
This is a example showing how to get information and change file and folder date time.
Said to be a little more difficult on NT based operating systems this example does that using API.
Please note that this example as such doesn't work on win 9x.

If you don't want to deal with directories then use the built in VDS commands:
@FILE(<file description>, T)
and
FILE SETDATE, <file path>, <time>, <date>

However it may not set all the 3 attributes seperately.


Here are the commands and functions available in this DSU :

Get File/Folder Date time Info:
=========================
%A= @FILEINFO(GET,CREATED,%F)

%A= @FILEINFO(GET,MODIFIED,%F)

%A= @FILEINFO(GET,ACCESSED,%F)

where %F is the path of the file or directory to obtain info.


Set the File File/Folder Date time Info:
========================================

FILEINFO SET,CREATED,%F,Date,Month,year,hour,min,sec

FILEINFO SET,MODIFIED,%F,Date,Month,year,hour,min,sec

FILEINFO SET,ACCESSED,%F,Date,Month,year,hour,min,sec

where %F is the path of the file or directory to be modified.


Win 9x version may be easier but I never tried one for it. Because I am not currently using it. Sorry.

Disclaimer:
===========
The unit uses windows API. Use at your own risk.


Enjoy.

CodeScript


Any suggestions
Mail me :
codescript2002@yahoo.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group