Hi all.
Did anyone knows easy way of creating the relative path to the file using the current directory and full path name of the file?

Regards.
Posted on 2003-11-02 23:34:10 by JohnFound
1) No offense, but learn to use gOOgLe!

2) Get your clue here:

http://cvs.openmicroscopy.org.uk/horde/chora/co.php/OME/src/C/abs2rel.c

I don't think it's any easier than this.


aweX <-
Posted on 2003-11-03 00:04:45 by aweX
Thank you aweX.
Actually before asking I tryed to search:
API reference/google/board FAQ/ but nothing found.

This is only reason to disturb your calmness with my stupid questions. ;)

Regards.
Posted on 2003-11-03 00:45:06 by JohnFound
Hey JohnFound,

I think you need to create your own parser to get the relative path. Not too difficult I think...
Posted on 2003-11-03 01:59:43 by roticv
I write it just now, because I can't read C :grin:
I will try to post it today in the algorithms forum.

Regards.
Posted on 2003-11-03 03:31:53 by JohnFound
There's also an API function that does this: PathRelativePathTo (from Shlwapi)
Posted on 2003-11-03 10:28:38 by Morris

There's also an API function that does this: PathRelativePathTo (from Shlwapi)


Hm, actually it is not in my API reference help...
BTW: I write a procedure for this. Look here: http://www.asmcommunity.net/board/index.php?topic=15925
Posted on 2003-11-03 23:16:52 by JohnFound
Now that's one funny thing :eek:
There are numerous exports in shlwapi, starting with "Path",
but MSDN knows nothing about them:

Ord: 497 (01F1h) Name: PathAddBackslashA
Ord: 498 (01F2h) Name: PathAddBackslashW
Ord: 499 (01F3h) Name: PathAddExtensionA
Ord: 500 (01F4h) Name: PathAddExtensionW
Ord: 501 (01F5h) Name: PathAppendA
Ord: 502 (01F6h) Name: PathAppendW
Ord: 503 (01F7h) Name: PathBuildRootA
Ord: 504 (01F8h) Name: PathBuildRootW
Ord: 505 (01F9h) Name: PathCanonicalizeA
Ord: 506 (01FAh) Name: PathCanonicalizeW
Ord: 507 (01FBh) Name: PathCombineA
Ord: 508 (01FCh) Name: PathCombineW
Ord: 509 (01FDh) Name: PathCommonPrefixA
Ord: 510 (01FEh) Name: PathCommonPrefixW
Ord: 511 (01FFh) Name: PathCompactPathA
Ord: 512 (0200h) Name: PathCompactPathExA
Ord: 513 (0201h) Name: PathCompactPathExW
Ord: 514 (0202h) Name: PathCompactPathW
Ord: 515 (0203h) Name: PathCreateFromUrlA
Ord: 516 (0204h) Name: PathCreateFromUrlW
Ord: 517 (0205h) Name: PathFileExistsA
Ord: 518 (0206h) Name: PathFileExistsW
Ord: 519 (0207h) Name: PathFindExtensionA
Ord: 520 (0208h) Name: PathFindExtensionW
Ord: 521 (0209h) Name: PathFindFileNameA
Ord: 522 (020Ah) Name: PathFindFileNameW
Ord: 523 (020Bh) Name: PathFindNextComponentA
Ord: 524 (020Ch) Name: PathFindNextComponentW
Ord: 525 (020Dh) Name: PathFindOnPathA
Ord: 526 (020Eh) Name: PathFindOnPathW
Ord: 527 (020Fh) Name: PathFindSuffixArrayA
Ord: 528 (0210h) Name: PathFindSuffixArrayW
Ord: 529 (0211h) Name: PathGetArgsA
Ord: 530 (0212h) Name: PathGetArgsW
Ord: 531 (0213h) Name: PathGetCharTypeA
Ord: 532 (0214h) Name: PathGetCharTypeW
Ord: 533 (0215h) Name: PathGetDriveNumberA
Ord: 534 (0216h) Name: PathGetDriveNumberW
Ord: 535 (0217h) Name: PathIsContentTypeA
Ord: 536 (0218h) Name: PathIsContentTypeW
Ord: 537 (0219h) Name: PathIsDirectoryA
Ord: 538 (021Ah) Name: PathIsDirectoryEmptyA
Ord: 539 (021Bh) Name: PathIsDirectoryEmptyW
Ord: 540 (021Ch) Name: PathIsDirectoryW
Ord: 541 (021Dh) Name: PathIsFileSpecA
Ord: 542 (021Eh) Name: PathIsFileSpecW
Ord: 544 (0220h) Name: PathIsLFNFileSpecA
Ord: 545 (0221h) Name: PathIsLFNFileSpecW
Ord: 546 (0222h) Name: PathIsNetworkPathA
Ord: 547 (0223h) Name: PathIsNetworkPathW
Ord: 548 (0224h) Name: PathIsPrefixA
Ord: 549 (0225h) Name: PathIsPrefixW
Ord: 550 (0226h) Name: PathIsRelativeA
Ord: 551 (0227h) Name: PathIsRelativeW
Ord: 552 (0228h) Name: PathIsRootA
Ord: 553 (0229h) Name: PathIsRootW
Ord: 554 (022Ah) Name: PathIsSameRootA
Ord: 555 (022Bh) Name: PathIsSameRootW
Ord: 556 (022Ch) Name: PathIsSystemFolderA
Ord: 557 (022Dh) Name: PathIsSystemFolderW
Ord: 558 (022Eh) Name: PathIsUNCA
Ord: 559 (022Fh) Name: PathIsUNCServerA
Ord: 560 (0230h) Name: PathIsUNCServerShareA
Ord: 561 (0231h) Name: PathIsUNCServerShareW
Ord: 562 (0232h) Name: PathIsUNCServerW
Ord: 563 (0233h) Name: PathIsUNCW
Ord: 564 (0234h) Name: PathIsURLA
Ord: 565 (0235h) Name: PathIsURLW
Ord: 566 (0236h) Name: PathMakePrettyA
Ord: 567 (0237h) Name: PathMakePrettyW
Ord: 568 (0238h) Name: PathMakeSystemFolderA
Ord: 569 (0239h) Name: PathMakeSystemFolderW
Ord: 570 (023Ah) Name: PathMatchSpecA
Ord: 571 (023Bh) Name: PathMatchSpecW
Ord: 572 (023Ch) Name: PathParseIconLocationA
Ord: 573 (023Dh) Name: PathParseIconLocationW
Ord: 574 (023Eh) Name: PathQuoteSpacesA
Ord: 575 (023Fh) Name: PathQuoteSpacesW
Ord: 576 (0240h) Name: PathRelativePathToA
Ord: 577 (0241h) Name: PathRelativePathToW
Ord: 578 (0242h) Name: PathRemoveArgsA
Ord: 579 (0243h) Name: PathRemoveArgsW
Ord: 580 (0244h) Name: PathRemoveBackslashA
Ord: 581 (0245h) Name: PathRemoveBackslashW
Ord: 582 (0246h) Name: PathRemoveBlanksA
Ord: 583 (0247h) Name: PathRemoveBlanksW
Ord: 584 (0248h) Name: PathRemoveExtensionA
Ord: 585 (0249h) Name: PathRemoveExtensionW
Ord: 586 (024Ah) Name: PathRemoveFileSpecA
Ord: 587 (024Bh) Name: PathRemoveFileSpecW
Ord: 588 (024Ch) Name: PathRenameExtensionA
Ord: 589 (024Dh) Name: PathRenameExtensionW
Ord: 590 (024Eh) Name: PathSearchAndQualifyA
Ord: 591 (024Fh) Name: PathSearchAndQualifyW
Ord: 592 (0250h) Name: PathSetDlgItemPathA
Ord: 593 (0251h) Name: PathSetDlgItemPathW
Ord: 594 (0252h) Name: PathSkipRootA
Ord: 595 (0253h) Name: PathSkipRootW
Ord: 596 (0254h) Name: PathStripPathA
Ord: 597 (0255h) Name: PathStripPathW
Ord: 598 (0256h) Name: PathStripToRootA
Ord: 599 (0257h) Name: PathStripToRootW
Ord: 600 (0258h) Name: PathUnExpandEnvStringsA
Ord: 601 (0259h) Name: PathUnExpandEnvStringsW
Ord: 602 (025Ah) Name: PathUndecorateA
Ord: 603 (025Bh) Name: PathUndecorateW
Ord: 604 (025Ch) Name: PathUnmakeSystemFolderA
Ord: 605 (025Dh) Name: PathUnmakeSystemFolderW
Ord: 606 (025Eh) Name: PathUnquoteSpacesA
Ord: 607 (025Fh) Name: PathUnquoteSpacesW


aweX <-
Posted on 2003-11-07 16:50:11 by aweX
Oh, really? You must have an outdated or incomplete MSDN installation.

MSDN 10'2001 includes information for all these functions.
Also, the online MSDN "knows" about these functions: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/shlwapi/path/path.asp
Posted on 2003-11-08 01:48:29 by Morris
Well, I searched the online MSDN for the string Path and expected it
to find these functions, in case it knows them ... hmmm, must be hard to
create a halfways reasonable search engine :rolleyes:

After all, JohnFound's problem is solved :)


aweX <-
Posted on 2003-11-08 04:54:29 by aweX