You can also reconsider whether the direct path to the pantry is that important. Everyone is capable of opening a door. In the worst case, you just make two trips because you can only carry something with one hand/arm. The pantry is close enough for that. I would definitely not want to block the hallway with such a door. A sliding door is even more cumbersome to open than a hinged door. Toward the pantry, that would be too inconvenient for me. I would probably stick to the original plan. That also doesn't cost anything extra. Show the rest of the floor plan. Then more can be said.