rejetto forum
Software => HFS ~ HTTP File Server => Topic started by: lewellyn on March 30, 2007, 12:09:15 PM
-
Is it somehow possible to specify a relative path for a real folder? I intend to use HFS on a thumb drive, and the drive letters may change depending on which system I'm on... I tried editing the VFS file to specify the relative path. Helpful hint: don't do that... ;D
Perhaps as a feature request for a new preference: If a real folder is added on the same drive as HFS, use a relative path rather than an absolute path.
Also, it'd be neat if we could add a "link" to special shell folders. That way, "My Documents" would point to that folder, no matter who I'm logged in as.
Perhaps these things are already possible, if undocumented. In that case, lemme know! :)
Also, if anyone has any input on other pitfalls with HFS and thumb drives, I'm all ears.
Thanks,
--Matt
-
Is it somehow possible to specify a relative path for a real folder?
nope :(
I intend to use HFS on a thumb drive, and the drive letters may change depending on which system I'm on... I tried editing the VFS file to specify the relative path. Helpful hint: don't do that... ;D
i would try to shift all characters backward by 2 steps, and fill the trailing 2 spaces with 0x20 (blank space)
Perhaps as a feature request for a new preference: If a real folder is added on the same drive as HFS, use a relative path rather than an absolute path.
i wish this could be a solution, but would just break other cases, where people may move hfs itself.
but...ugh... i may think of ASKING with a yes/no dialog.
since it would be something hard to understand for users, this could happen only in expert mode.
a better idea would be to detect a removable drive, and omit letter drive in such case, but i don't know how to do that, yet.
Also, it'd be neat if we could add a "link" to special shell folders. That way, "My Documents" would point to that folder, no matter who I'm logged in as.
hmm, how you imagine the GUI would be in details?
i could also make a command "add special folder", available in expertmode, and it would let you specify if you want a relative path, or another special folder.
ok, for now i added these 2 points to my to-do list
+ pen drive support: when adding a folder with same drive, and the drive is removable, don't consider letter drive
+ add special folder (expert mode): let you specify a special folder, like documents, or manually enter a path (useful for relative)
-
i would try to shift all characters backward by 2 steps, and fill the trailing 2 spaces with 0x20 (blank space)
No go. I removed the H: and appended two 0x20s to the end of the path. It failed the CRC check (of course), and still locks up when I tell it to continue. :( I'll live ;)
i wish this could be a solution, but would just break other cases, where people may move hfs itself.
but...ugh... i may think of ASKING with a yes/no dialog.
since it would be something hard to understand for users, this could happen only in expert mode.
a better idea would be to detect a removable drive, and omit letter drive in such case, but i don't know how to do that, yet.
I thought (briefly) about the idea of HFS itself moving. Then I thought that I'm more likely to end up with different drive letters. ;)
As for the detection, I dunno if you're using managed C++ or whatnot (I've honestly not even bothered to investigate that...), but MSDN mentions the WMI class Win32_DiskDrive. Perhaps check for the value of the MediaType property for the volume where both the VFS file and HFS are located? (This would only be a useful automation if both resided on the same flash drive, I suppose.)
On Vista, it seems you'd be looking for either of these strings: "External Hard Disk Media" or "Removable media other than floppy". On NT4-XP/2003: "Removable media". (Perhaps also the "Unknown" values, too? I've also not looked into what may be Unknown...)
I suppose that there are likely non-WMI methods exposed somewhere, but I'm not up to digging through MSDN at 10pm... ;)
And, instead of asking, or even making it truly automatic only in Expert Mode, perhaps a toggle for "Flash/Network drive use". There are ways of checking if a drive's local or not, too. ;) Oh, and it would allow you to add other "portable" gestures in the future in such a way that people won't get confused by the multitude of options! ;D
hmm, how you imagine the GUI would be in details?
i could also make a command "add special folder", available in expertmode, and it would let you specify if you want a relative path, or another special folder.
That's about what I imagined. I can't imagine anyone who's afraid of expert mode wanting to comprehend how special folders work. Of course... for those users, it could be "automagic" if they have the aforementioned "portable" option toggled on.
Oh, and a super-expert feature... besides a dropdown of the most common special folders, have a spot to insert your own GUID? That way if I want to share out Application X's "My X Files" folder, I just pop in its GUID. But then... back to the portability thing... I suppose that if the GUID is not available when mounting the VFS, "X out" the folder icon and just don't list it (or list it without a link)? That way, the only "breakage" is that the file listings don't act quite the same as on the original system. But it's better than tossing out cryptic errors.
ok, for now i added these 2 points to my to-do list
+ pen drive support: when adding a folder with same drive, and the drive is removable, don't consider letter drive
+ add special folder (expert mode): let you specify a special folder, like documents, or manually enter a path (useful for relative)
Whee! I look forward to both of these items. In fact, I'm willing to alpha test them! :)
I've added this thread to my home page tabs so that I don't forget where it was. :)
--Matt
P.S. I just noticed that you use Delphi... I'll install it on this particular box just to see if I can't hack some proof-of-concept or something up. BTW, will modifying the sources with Delphi 7 cause any grief? I've not really played with Delphi much (I left it alone after it "evolved" from Pascal...), so I'm hoping that there's no migration woes if I hack up some drive type detection scheme... Sources are downloaded and I've got nothing to do in the morning. Wish me some luck! :)
P.P.S. Do you have a VFS editor available? ;) And are the sources the only docs for the file format?
-
I use HFS on an external hard drive so I would too be interested in this.
The strategy I use is that from the get-go I assigned my external hard drive a letter further in in the alphabet, that way I can manually change the letter drive whenever I plug it into a different computer.
-
Perhaps check for the value of the MediaType property for the volume where both the VFS file and HFS are located? (This would only be a useful automation if both resided on the same flash drive, I suppose.)
yes, i used getDriveType(), available from build 090.
Oh, and a super-expert feature... besides a dropdown of the most common special folders, have a spot to insert your own GUID?
i will think of it :)
P.S. I just noticed that you use Delphi...
just switched to delphi 2006 (free edition)
BTW, will modifying the sources with Delphi 7 cause any grief?
no idea
Sources are downloaded and I've got nothing to do in the morning. Wish me some luck! :)
reckless!
P.P.S. Do you have a VFS editor available? ;) And are the sources the only docs for the file format?
yes, only sources. it's a Type-Length-Value nested structure.
-
yes, i used getDriveType(), available from build 090.
Sorry Rejetto,
"getDriveType" is only in HFS code or there is a command that can be viewed also in Main Menu or
VFS Menu ?
ciao
-
that functionality is automatic, there is no menu.
getDriveType() is how i implemented it, in the source, it was a programming argument.
-
Is it somehow possible to specify a relative path for a real folder? I intend to use HFS on a thumb drive, and the drive letters may change depending on which system
i don't read all off the topic but i have put hsf on usb key
on XP, into "My computer" you can modify letters of drives, i use it to rename usb key to V:
when i put the key on any usb port, usb drive appear with V: letter
make it with all yours computers and work fine
-
Is it somehow possible to specify a relative path for a real folder? I intend to use HFS on a thumb drive, and the drive letters may change depending on which system
i don't read all off the topic but i have put hsf on usb key
on XP, into "My computer" you can modify letters of drives, i use it to rename usb key to V:
when i put the key on any usb port, usb drive appear with V: letter
make it with all yours computers and work fine
As a result of this thread HFS' USB drive support was improved to allow for relative paths, so please read it all or atleast most in the future.