The short answer is "sure, why not?" A will disposes of the deceased's property. In many cases a digital file can be treated in the same way as an analogous item of personal property such as a chattel (like a book or a key) or chose in action (like a bank account or share certificate). If the analogy holds up and the executor faithfully executes the deceased's instructions, then there is no problem.
When the analogy breaks down because of the fundamental differences between digital files and the established categories of property, this highlights the amorphous nature of property itself. In the common law system, property is just a bundle of rights which can be enforced by starting litigation by analogy to previous cases. To answer your question properly, we need to analyse the problem in terms of hypothetical parties who could sue each other and persuade the court to make or not make particular orders.
Assume that the deceased writes in their will that "person A should get file A from my laptop and person B should get file B," but the executor just gives the laptop to A. B could sue the executor for breach of trust, and argue that file B was an item of personal property which the executor was bound to transfer to B. The executor could reply that the clause was a non-binding expression of wishes, to be treated in the same way as a direction about funeral arrangements. To resolve this dispute, the court would hear evidence about why file B is so important and perhaps, why the executor chose not to comply with the deceased's wish. These details could be important to the court's determination of the resulting questions of property law and equity.
On the other hand, suppose the executor gives B a copy of file B, then gives the laptop to A with the original version of file B still on it. This might defeat the testator's goal of giving file B exclusively to B (which would go without saying, if the file were an item of personal property). Whether B could somehow enforce that exclusivity would again raise complicated questions of equity, and perhaps copyright. On the other hand, if the reason for exclusivity was that file B was a Bitcoin wallet (which A then appropriates), the analogy to tangible property might become workable again.
This means that the longer answer to your question is "maybe, but anybody who wanted to enforce that part of your will would need to persuade the court that the file can be treated as personal property, or that your executor is otherwise obliged to follow your instructions about the file as a matter of trust law."